title: onClick crashing app when executing AsyncTask
body: <p>I am having some trouble with an AsyncTask that I am trying to run with a button onClick event. I had it working in the "HomePageActivity" but then transferred the codes over into a new activity and now the app crashes when the button is clicked. It used to work perfectly.</p>
  
  <p>Can anyone help me figure this out?
  I'm sure it's something simple that a new pair of eyes can spot.</p>
  
  <pre><code>public class GamesOverview extends HomePageActivity {
  
  public final static String BaseUrl="http://URL.com/"; 
   ArrayList&lt;DEPT_HOLD&gt; deptList=new ArrayList&lt;DEPT_HOLD&gt;();
  
  private class GetDeptAyncTask extends AsyncTask&lt;Hashtable&lt;String,String&gt;,Void,String&gt;{  
   // Parse in background
   @Override
   protected String doInBackground(Hashtable&lt;String,String&gt;... params) {
    @SuppressWarnings("rawtypes")
    Hashtable ht=params[0];
    @SuppressWarnings("unchecked")
    String json=HelperHttp.getJSONResponseFromURL(BaseUrl+"JSONURLGOESHERE", ht);
     if(json!=null) parseJsonString(deptList,json);
     else {
      return "Invalid Company Id";
     }
      return "SUCCESS";
   }
   // Parse JSON
   protected void parseJsonString(ArrayList&lt;DEPT_HOLD&gt; deptList,String json) {
    try {
     JSONObject top = new JSONObject(json);
     JSONObject topAdds = (JSONObject) top.get("topAdds");
     JSONArray array = (JSONArray) topAdds.get("player");
      for(int i = 0; i &lt; array.length(); i++) {
       JSONObject j = array.getJSONObject(i);
       DEPT_HOLD d = new DEPT_HOLD();
        d.one = j.optString("percent","");
        d.two = j.optString("id","");
         deptList.add(d);
      }
    } catch (JSONException e) {
     e.printStackTrace();
    }
   } 
   // Execute post
   @Override
   protected void onPostExecute(String result) {
    if(result=="SUCCESS") {
     Toast.makeText(GamesOverview.this, "Success"+deptList, Toast.LENGTH_SHORT).show();
     DeptArrayAdapter adapter=new DeptArrayAdapter(GamesOverview.this,R.id.text1,deptList);
     ListView listv=(ListView)findViewById(R.id.lv);
     listv.setAdapter(adapter);
    }
    else{}
   }    
  }
  
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
  
    // Scrolling
    ScrollView scroll;
    scroll = new ScrollView(this);
     HorizontalScrollView horizontalscroll;
     horizontalscroll = new HorizontalScrollView(this);
    // End
  
      // Get JSON button
      final Button JSONButton = new Button(this);
       JSONButton.setText("Get JSON");
       JSONButton.setTextSize(20);
       JSONButton.setTextColor(Color.rgb(000,000,000));
        JSONButton.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
          executeAsyncTask();
         }
        });
      // End
  
      // LAYOUT
      LinearLayout layout = new LinearLayout(this);
       layout.setOrientation(LinearLayout.VERTICAL);
       layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
       LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(getWindowManager().getDefaultDisplay().getWidth(),getWindowManager().getDefaultDisplay().getHeight());
        layout.setGravity(Gravity.CENTER_HORIZONTAL);
         layout.setBackgroundResource(R.drawable.body_bg);
          // DisplayJSONButton
          LinearLayout displayJSONButtonlayout = new LinearLayout(this);
           displayJSONButtonlayout.setOrientation(LinearLayout.HORIZONTAL);
           displayJSONButtonlayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
           LinearLayout.LayoutParams displayJSONButtonlayout_params = new LinearLayout.LayoutParams(getWindowManager().getDefaultDisplay().getWidth()-50,100);
            displayJSONButtonlayout_params.setMargins(0,10,0,0);
            displayJSONButtonlayout.setGravity(Gravity.CENTER_HORIZONTAL);
             displayJSONButtonlayout.addView(JSONButton,displayJSONButtonlayout_params);
      // END LAYOUT       
  
       layout.addView(displayJSONButtonlayout);
        layout.requestLayout();
  
        // Enable scrolling
        scroll.addView(layout,layoutparams);
        horizontalscroll.addView(scroll);
  
         // Set content view
         setContentView(horizontalscroll);
  
  }
  
  // Finish up task
  @SuppressWarnings("unchecked")
  private void executeAsyncTask(){
   Hashtable&lt;String,String&gt; ht=new Hashtable&lt;String,String&gt;();
   GetDeptAyncTask async=new GetDeptAyncTask();
    ht.put("", "");
     @SuppressWarnings("rawtypes")
     Hashtable[] ht_array={ht};
      async.execute(ht_array);
  }
  
  }
  </code></pre>
  
  <p>All of the logcat information that I can find:</p>
  
  <pre><code>?:??: W/?(?): URL==&gt;http://football.myfantasyleague.com/2007/export?TYPE=topAdds&amp;W=12&amp;JSON=1?=
  ?:??: W/?(?): Forward DNS query to netd(h=football.myfantasyleague.com s=^)
  ?:??: W/?(?):   at myfantasyleague.app.GamesOverview$GetDeptAyncTask.onPostExecute(GamesOverview.java:73)
  ?:??: W/?(?):   at myfantasyleague.app.GamesOverview$GetDeptAyncTask.onPostExecute(GamesOverview.java:1)
  ?:??: W/?(?):   Force finishing activity myfantasyleague.app/.GamesOverview
  ?:??: W/?(?): read: 04-02 14:42:47.990   464   474 W ActivityManager:   Force finishing activity myfantasyleague.app/.GamesOverview
  ?:??: W/?(?): app: myfantasyleague.app
  ?:??: W/?(?): Activity pause timeout for ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}
  ?:??: W/?(?): read: 04-02 14:42:48.521   464   477 W ActivityManager: Activity pause timeout for ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}
  ?:??: W/?(?): ACTION_PACKAGE_REMOVED: myfantasyleague.app
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?): 卸载了:myfantasyleague.app
  ?:??: W/?(?): myfantasyleague.app
  ?:??: W/?(?): PackageMonitor: doOnReceive(): android.intent.action.PACKAGE_REMOVED [myfantasyleague.app] REPLACING:true
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?): PackageMonitor: doOnReceive(): android.intent.action.PACKAGE_REMOVED [myfantasyleague.app] REPLACING:true
  ?:??: W/?(?): PackageMonitor: doOnReceive(): android.intent.action.PACKAGE_ADDED [myfantasyleague.app] REPLACING:true
  ?:??: W/?(?): Activity idle timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): PackageMonitor: doOnReceive(): android.intent.action.PACKAGE_ADDED [myfantasyleague.app] REPLACING:true
  ?:??: W/?(?): read: 04-02 14:42:58.560   464   477 W ActivityManager: Activity idle timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?): Activity pause timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): read: 04-02 14:43:48.631   464   477 W ActivityManager: Activity pause timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?): Activity destroy timeout for ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}
  ?:??: W/?(?): Activity stop timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): read: 04-02 14:43:58.857   464   477 W ActivityManager: Activity destroy timeout for ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}
  ?:??: W/?(?): read: 04-02 14:43:58.857   464   477 W ActivityManager: Activity stop timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): This window was lost: Window{425b0c78 myfantasyleague.app/myfantasyleague.app.GamesOverview paused=false}
  ?:??: W/?(?): mToken=AppWindowToken{424bb208 token=Token{425d1e10 ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}}}
  ?:??: W/?(?): mRootToken=AppWindowToken{424bb208 token=Token{425d1e10 ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}}}
  ?:??: W/?(?): mAppToken=AppWindowToken{424bb208 token=Token{425d1e10 ActivityRecord{41881918 myfantasyleague.app/.GamesOverview}}}
  ?:??: W/?(?): mSurface=Surface(name=myfantasyleague.app/myfantasyleague.app.GamesOverview, identity=7073)
  ?:??: W/?(?):   #16: Token{421d65e8 ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}}
  ?:??: W/?(?):   #4: Window{42513558 myfantasyleague.app/myfantasyleague.app.MyFantasyLeagueActivity paused=false}
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?):   dummy: {}]
  ?:??: W/?(?): Activity idle timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): read: 04-02 14:44:09.037   464   477 W ActivityManager: Activity idle timeout for ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}
  ?:??: W/?(?): WIN DEATH: Window{42513558 myfantasyleague.app/myfantasyleague.app.MyFantasyLeagueActivity paused=false}
  ?:??: W/?(?): Process myfantasyleague.app (pid 14733) has died.
  ?:??: W/?(?): read: 04-02 14:44:40.935   464   866 I ActivityManager: Process myfantasyleague.app (pid 14733) has died.
  ?:??: W/?(?): Force removing ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}: app died, no saved state
  ?:??: W/?(?): WIN DEATH: Window{425b0c78 myfantasyleague.app/myfantasyleague.app.GamesOverview paused=false}
  ?:??: W/?(?): read: 04-02 14:44:40.935   464   866 W ActivityManager: Force removing ActivityRecord{4184f330 myfantasyleague.app/.MyFantasyLeagueActivity}: app died, no saved state
  ?:??: W/?(?):   dummy: {}]
  </code></pre>