Good evening. There is an AsyncTask that receives data from the server. During work I call

onProgressUpdate(Item... values); { super.onProgressUpdate(values); items.add(values[0]); Log.d(TAG, values[0].toString()); adapter.notifyDataSetChanged(); } 

where items is ArrayList<Item> , adapter is ArrayAdapter . No items are added (Data arrives correct). If you carry out the same actions in onCreate() then the element will be added. What could be wrong?

  • under debugger what shows? - rjhdby
  • 2
    adapter exactly contains exactly the list of items and not a copy of it? How do you write items to adapter ? - xkor
  • @xkor, ArrayList<Item> items = new ArrayList<>(); adapter adapter = new mAdapter(this, items); mAdapter - adapter for my markup - kBro
  • then there may be a problem in the code of your mAdapter - xkor
  • @xkor, I can add an element in the same onCreate() method, in other activities everything also works with the same adapter - kBro

0