title: Why does my ListFragment just have a Loading Circle and not display the data I got from remote server?
body: <p>I have an application in android that would get data from a remote server and display it on a ListFragment. It is successful in getting the data as it shows on my LogCat but it does not display on the Activity itself where the ListFragment is. It just shows the loading circle and no matter how long I wait it still does the same thing. I am getting the data using httprequest and use an AsyncTask to get them.</p>
  
  <p>Here is the Main Activities codes :</p>
  
  <pre><code>package com.thesis.menubook;
  
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  
  import org.apache.http.NameValuePair;
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import android.app.ListActivity;
  import android.app.ProgressDialog;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.ArrayAdapter;
  
  
  public class MenuMain extends ListActivity {
      JSONParser jsonParser = new JSONParser();
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; categoryList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      private ProgressDialog pDialog;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_menu_main);
  
          // Populate Category List from database
          new GetCategories().execute();
  
          //set list on click listener for category
              // on category list click update fragment using dbase query
  
          // set swipe listener
              // on swipe update fragment using dbase query
  
          // set add button listener
              // on click add to order list list adapter
  
          // set order list listener
              // on click remove from list
  
          // set send button listener
              // update remote database using order list
      }
  
      class GetCategories extends AsyncTask&lt;String, String, String&gt; {
  
          /**
           * Before starting background thread Show Progress Dialog
           * */
          @Override
          protected void onPreExecute() {
               super.onPreExecute();
               pDialog = new ProgressDialog(MenuMain.this);
               pDialog.setMessage("Loading Categories. Please wait...");
               pDialog.setIndeterminate(false);
               pDialog.setCancelable(false);
               pDialog.show();
          }
  
          /**
           * Getting product details in background thread
           * */
          protected String doInBackground(String... param) {
              Bundle b = getIntent().getExtras();
              String ipaddress = b.getString("IPAddress");
  
              List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
              Log.d("IP ADDRESS", ipaddress +" ");
  
              JSONObject json = jsonParser.makeHttpRequest("http://"+ipaddress+"/MenuBook/selectCategories.php", "GET", params);
  
              // Check your log cat for JSON reponse
              Log.d("All Categories: ", json.toString() + " ");
              int num = 1;
              try {
                  // Checking for SUCCESS TAG
                  int success = json.getInt("success");
  
                  if (success == 1) {
                      // products found
                      // Getting Array of Products
  
                      JSONArray category_list = json.getJSONArray("category_list");
  
                      // looping through All Products
                      for (int j = 1; j &lt; category_list.length(); j++) {
                          JSONObject c = category_list.getJSONObject(j);
  
                          // Storing each json item in variable
                          String category = c.getString("category");
  
                          // creating new HashMap
                          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                          // adding each child node to HashMap key =&gt; value
                          map.put("category", category);
  
                          Log.d("category #"+num+"", category + " ");
                          num = num + 1;
                          // adding HashList to ArrayList
                          if(categoryList.contains(map) != true)
                          {
                              categoryList.add(map);
                          }
                          Log.d("Category List", categoryList.toString() + " ");
                      }
                  } 
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
              return null;
          }
  
          /**
           * After completing background task Dismiss the progress dialog
           * **/
          @Override
          protected void onPostExecute(String result) {
              pDialog.dismiss();
  
              ArrayAdapter&lt;ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt; arrayAdapter = new ArrayAdapter&lt;ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt;(MenuMain.this, R.layout.activity_menu_category);
              arrayAdapter.add(categoryList);
  
              if(arrayAdapter.isEmpty() == true)
              {
                  setListAdapter(null);
              }
              else
              {
                  setListAdapter(arrayAdapter);
              }
          }
  
      }
  
  
  
  }
  </code></pre>
  
  <p>and here is the ListFragments codes :</p>
  
  <pre><code>package com.thesis.menubook;
  
  import android.annotation.TargetApi;
  import android.app.ListFragment;
  import android.os.Build;
  import android.os.Bundle;
  
  @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  public class MenuCategory extends ListFragment {
  
      @Override
      public void onActivityCreated(Bundle savedState) {
          super.onActivityCreated(savedState);
  
      }
  
  
  
  }
  </code></pre>
  
  <p>This is the ListFragments XML :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ListView 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
  &lt;/ListView&gt;
  </code></pre>
  
  <p>And if it would help, here is the LogCat :</p>
  
  <pre><code>02-13 22:57:35.422: V/TLINE(1349): new: android.text.TextLine@4066c0c0
  02-13 22:57:36.702: V/TLINE(1349): new: android.text.TextLine@40674c00
  02-13 22:57:59.142: D/dalvikvm(1349): GC_FOR_ALLOC freed 161K, 5% free 6481K/6791K, paused 162ms
  02-13 22:57:59.184: I/dalvikvm-heap(1349): Grow heap (frag case) to 6.926MB for 513744-byte allocation
  02-13 22:57:59.562: D/dalvikvm(1349): GC_CONCURRENT freed 13K, 5% free 6969K/7303K, paused 50ms+26ms
  02-13 22:58:02.334: D/NetWork Info(1349): NetworkInfo: type: mobile[UMTS], state: CONNECTED/CONNECTED, reason: simLoaded, extra: internet, roaming: false, failover: false, isAvailable: true
  02-13 22:58:08.841: D/Response(1349): org.apache.http.message.BasicHttpResponse@406867f8--response from apache
  02-13 22:58:08.841: D/IP Address(1349): 192.168.10.149:80
  02-13 22:58:09.181: D/NEXT VALUE --in Async on postexecute(1349): true
  02-13 22:58:18.232: D/dalvikvm(1349): GC_CONCURRENT freed 139K, 4% free 7258K/7559K, paused 40ms+13ms
  02-13 22:58:18.802: D/URL(1349): http://192.168.10.149:80/MenuBook/checkTable.php
  02-13 22:58:23.082: D/Check Table(1349): {"success":1,"tabledb":[{"table_location":"UP","table_seat":"5","table_status":"AVAILABLE","table_ID":"001"}]}
  02-13 22:58:23.082: D/Table Status in doinbg(1349): AVAILABLE
  02-13 22:58:23.192: D/Table Status in post execute(1349): AVAILABLE
  02-13 22:58:25.622: D/IP ADDRESS(1349): 192.168.10.149:80 
  02-13 22:58:28.432: D/dalvikvm(1349): GC_CONCURRENT freed 353K, 7% free 7356K/7879K, paused 14ms+264ms
  02-13 22:58:32.556: D/All Categories:(1349): {"success":1,"category_list":[{"category":"MAIN DISH"},{"category":"MAIN DISH"},{"category":"DESSERT"}]} 
  02-13 22:58:33.273: D/Category List JSON Array(1349): [{"category":"MAIN DISH"},{"category":"MAIN DISH"},{"category":"DESSERT"}]
  02-13 22:58:33.852: D/category #1(1349): MAIN DISH 
  02-13 22:58:34.982: D/Category List(1349): [{category=MAIN DISH}] 
  02-13 22:58:35.164: D/category #2(1349): DESSERT 
  02-13 22:58:35.382: D/Category List(1349): [{category=MAIN DISH}, {category=DESSERT}] 
  02-13 22:58:35.664: D/Category List(1349): [{category=MAIN DISH}, {category=DESSERT}]
  </code></pre>