I have an activity_A which contains listView, this listView dynamically increases in size adding 10 items everytime I scroll to the bottom of the list, in the same activity_A I have an editTextView and a go_button which searches for the string in the editTextView.
Search is my activity_B which has a listView, even this listView dynamically increases in size adding 10 items every time.
My problem is when I want to go back to the activity_A from activity_B using a button click (not the back button of my device) it gives me this exception.
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread.
My way of going back to activity_A from activity_B is:
public void onClick(View v)
{
Intent intent = new Intent(activity_B.this, activity_A.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
I even tried by removing intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); line
try to use
requestLayout()for your ListView.