I have a DialogFragment from where i am adding the item to the database table.
And i have another Fragment, which has a ListView where i am displaying all items from the database.
I could add the item to the database, but it doesn’t immediately appear on the ListView, which is fetching the items from database.
you can use the method
yourListAdapter.notifyDataSetChanged(), see thisEDIT :
you add the item to database from fragment A , so you should create a global variable for your listAdapter in the fragment B ( the one which contains the
listView) , and get your fragment in your Fragment A by tag , and then you should call :EDIT 2 :
in your
CustomListAdapter, add a method to refresh your List of objects (my) :and then , when you add the new Object to your database, retreive all data from the database, and then call :