0
Этот код работает в BlueStacks, но когда смартфон работает со следующей ошибкой на дисплее журнала.set array list list list
Ошибка:
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. Make sure your adapter calls
notifyDataSetChanged() when its content changes. [in ListView(2131296334, class
android.widget.ListView) with Adapter(class android.widget.HeaderViewListAdapter)]
Код:
private void displayResultList() {
try {
array.clear();
array=baseHelper.results;
tView.setText("Size : " +array.size()+" "+ baseHelper.countmcur);
try {
if(arrayAdapter!=null)
arrayAdapter.notifyDataSetChanged();
arrayAdapter=new display();
listV.setAdapter(arrayAdapter);
arrayAdapter.notifyDataSetChanged();
} catch (Exception e) {
message.messages(contex, e.getMessage());
}
listV.setTextFilterEnabled(true);
} catch (Exception e) {
message.messages(contex, e.getMessage());
}
}
С какого места вы вызываете displayResultList? В случае, если это асинтеза, от doInBackground или от onPostExecute? – Mdlc
@ Mdlc, button.setOnClickListener – Negar