title: listview isn't filling through asynctask
body: <p>i'm currently trying to fill my listview with AsyncTask.</p>
  
  <p><strong>UPDATE</strong>:
  <strong>I updated my codes as following:</strong></p>
  
  <pre><code>@Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
      new loadSomeStuff(this.getActivity()).execute();
  
  }
  
  public static class loadSomeStuff extends
              AsyncTask&lt;FragmentActivity, Integer, String&gt; {
  
          ProgressDialog dialog;
          ArrayList&lt;BeanClass4&gt; beanClass4 = new ArrayList&lt;BeanClass4&gt;();
          SharedPreferences prefs;
          public static final String prefName = "SecretFile";
          FragmentActivity activity;
  
          public loadSomeStuff(FragmentActivity activity2) {
              // TODO Auto-generated constructor stub
              this.activity = activity2;
          }
  
          protected void onPreExecute() {
              dialog = new ProgressDialog(activity);
              dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
              dialog.setCancelable(false);
              dialog.setIndeterminate(false);
              dialog.setMessage("hi");
              dialog.show();
          }
  
          protected String doInBackground(FragmentActivity... params) {
              // TODO Auto-generated method stub
              beanClass4.clear();
              String result = "";
              InputStream isr = null;
              try {
                  HttpClient httpclient = new DefaultHttpClient();
                  String url = "";
                  HttpPost httpost = new HttpPost(url);
                  HttpResponse resposne = httpclient.execute(httpost);
                  HttpEntity entity = resposne.getEntity();
                  isr = entity.getContent();
              } catch (Exception e) {
                  Log.e("log_httpconnection",
                          "error in http connection" + e.toString());
              }
  
              try {
                  BufferedReader reader = new BufferedReader(
                          new InputStreamReader(isr, "UTF-8"), 8);
                  StringBuilder sb = new StringBuilder();
                  String line = null;
                  while ((line = reader.readLine()) != null) {
                      sb.append(line + "\n");
                  }
                  isr.close();
                  result = sb.toString();
              } catch (Exception e) {
                  Log.e("log_json", "Error converting Result " + e.toString());
              }
              try {
  
                  JSONArray jArray = new JSONArray(result);
                  for (int i = 0; i &lt; jArray.length(); i++) {
  
                      JSONObject json = jArray.getJSONObject(i);
                      beanClass4.add(new BeanClass4(json.getString("PhoneName"),
                              json.getString("ModelNumber"), json
                                      .getString("PhonePrice"), json
                                      .getString("imageurl"), json
                                      .getString("moneyunit"), json
                                      .getString("newphone")));
                  }
                  dialog.dismiss();
              } catch (Exception e) {
                  Log.e("lag_tag", "ERROR PARSING DATA" + e.toString());
                  beanClass4.clear();
              }
              return null;
          }
  
          protected void onProgressUpdate(Integer... progress) {
  
          }
  
          protected void onPostExecute(String result) {
              listview.setAdapter(new MyListAdapter4(activity, beanClass4));
              if (beanClass4.isEmpty()) {
                  Toast.makeText(activity, "No Connection", Toast.LENGTH_LONG)
                          .show();
              }
  
          }
  
      }
  </code></pre>
  
  <p>However, now when i open my activity. I see a progressdialog saying hi, then after 2~3 seconds i got this on logcat:</p>
  
  <pre><code>07-23 13:18:55.236: E/AndroidRuntime(1230): FATAL EXCEPTION: main
  07-23 13:18:55.236: E/AndroidRuntime(1230): java.lang.NullPointerException
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at com.androidarabia.utils.Taby$loadSomeStuff.onPostExecute(Taby.java:268)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at com.androidarabia.utils.Taby$loadSomeStuff.onPostExecute(Taby.java:1)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.os.AsyncTask.finish(AsyncTask.java:631)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.os.AsyncTask.access$600(AsyncTask.java:177)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.os.Looper.loop(Looper.java:137)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at android.app.ActivityThread.main(ActivityThread.java:5293)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  07-23 13:18:55.236: E/AndroidRuntime(1230):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>What do do? YOUR HELP WILL BE MUCH MUCH APPRECIATED!</p>