There were problems when updating the list view from the broadcast receiver .
There is a listView on the fragment, there is a ConnectionChangeReceiver .
It is necessary, when changing the connection of the device (Internet access), to show something like "No access to the Internet" in LV , or, conversely, to remove this inscription.
The problem is that I updated LV , for example like this:
JournalFragment journalFragment = (JournalFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentByTag(JournalFragment.TAG); (journalFragment).updateLV(); but I can’t get the MainActivity from the onReceive method, there is a context , of course, but I cannot imagine it as a (MainActivity) context .
What to do ?