Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid, synctask not showing the list after progressDialog
    primarykey
    data
    text
    <p>I was using AsyncTask to display data on a List, But the loading is visible, but it dosen't show the list.. </p> <pre><code> public void getLocations(){ Connect client = new Connect(SERVICE_URI + "/GetLocations"); client.AddHeader("Accept", "application/json"); client.AddHeader("Content-Type", "application/json"); try { client.Execute(RequestMethod.GET); JSONObject rootJson = new JSONObject(client.getResponse()); JSONArray jsonArray = rootJson.getJSONArray("GetLocationsResult"); String[] names = null; if (jsonArray != null) { names = new String[jsonArray.length()]; for (int i = 0; i &lt; jsonArray.length(); i++) { JSONObject json = jsonArray.getJSONObject(i); names[i] = json.getString("Name"); } } setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, names)); } catch (JSONException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } public void getLocations(){ Connect client = new Connect(SERVICE_URI + "/GetLocations"); client.AddHeader("Accept", "application/json"); client.AddHeader("Content-Type", "application/json"); try { client.Execute(RequestMethod.GET); JSONObject rootJson = new JSONObject(client.getResponse()); JSONArray jsonArray = rootJson.getJSONArray("GetLocationsResult"); String[] names = null; if (jsonArray != null) { names = new String[jsonArray.length()]; for (int i = 0; i &lt; jsonArray.length(); i++) { JSONObject json = jsonArray.getJSONObject(i); names[i] = json.getString("Name"); } } setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, names)); } catch (JSONException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload