Note that there are some explanatory texts on larger screens.

plurals
  1. POrefresh data in listview when data from server
    primarykey
    data
    text
    <p>I'm having a problem refresh the data in list view. I get the data in the list from a server, and when I want to refresh the data I need to go to the server and receive the new data. the notifyDataSetChanged() not helping and also the ListView.invalidateViews not helping. when I rotate the device the list updated. how can I load the list view in the same way the screen rotation do it?</p> <p>This is the code on create that fill the list view.</p> <p>thanks in advance.</p> <pre><code>query = new ParseQuery(PET_CLASS_NAME); petListView.addHeaderView((View)getLayoutInflater().inflate(R.layout.header_row, null)); petDetailIntent = new Intent(getApplicationContext(), PetDetailActivity.class); selectCityIntent = new Intent(this, CitiesActivity.class); loadingIntent = new Intent(getApplicationContext(), LoadingActivity.class); startActivityForResult(loadingIntent, LOADING_INTENT_CODE); /*the user see list of pets that are still missing*/ query.whereEqualTo(PET_FOUNDED, false); selectedCity = settings.getString("cityQuery", ""); if(selectedCity != ""){ query.whereEqualTo(PET_CITY, selectedCity); } query.findInBackground(new FindCallback() { @Override public void done(List&lt;ParseObject&gt; list, ParseException e) { if (e == null) { //objects retrieved well petList.addAll(list); //MyAdapter adapter = new MyAdapter( getApplicationContext(), android.R.layout.simple_list_item_1, R.id.tv_pet_name, petList); setListAdapter(adapter); } else{ toaster(getResources().getString(R.string.error_message_load_pets)); finish(); } finishActivity(LOADING_INTENT_CODE); } }); </code></pre>
    singulars
    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.
    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