I have an activity that stores NFC reads into my apps database. I have a fragment that has a ListView with data bound by a cursor adapter to that same database.
The activity handles the intent in the foreground but when I swipe to the fragment, the listview has not been updated with the databases latest data.
What is the best way to tell the fragment to update the listview when my activity adds the NFC read to the database?
The fragment is being managed in the activity by a viewpager, so I can't get access to the fragment with getFragmentById() because I don't have an ID. I've read some weird android:switcher hack to access the ID or Tag of the fragment but that doesn't seem like a good idea.
3 possible ways: