Skip to content Skip to sidebar Skip to footer

Getsupportfragmentmanager().findfragmentbyid Returning Null

What I am doing: updating UI (Fragment UI) from Broadcast Receiver. But while finding Fragment I am getting null in return. OnReceive (Broadcast Receiver): if(MainActivity.getInst

Solution 1:

Use getSupportFragmentManager().executePendingTransactions() after fragment transaction. After calling this method you can get the fragment using both findFragmentById() and findFragmentByTag() methods.

Also make sure you pass Valid Id or Tag for the fragment.

Post a Comment for "Getsupportfragmentmanager().findfragmentbyid Returning Null"