I have a list of items. I have a button that sends you to another activity in order to create a new item. When the new item is saved an intent sends you back to the activity with the list where the new item should be added. The adapter extends from BaseAdapter without filtering, it just sets the data to the views.
My code is this:
onCreate(){
ListView listView = findItemById......
listView.setListeners.......
}
onResume(){
data = getData();
adapter = new ListAdapter(context,data);
listView.setAdapter(adapter);
}
It works but is this correct?
Can I use creation of adapter and setAdapter in onCreate and use notifyDataSetChanged() only in onResume somehow?