Return current fragment on main activity

This commit is contained in:
Javi Rueda 2021-03-19 12:53:32 +01:00
parent 686eb7fd33
commit 96606f54fd

View file

@ -2781,12 +2781,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
} }
private Fragment getCurrentFragment() { private Fragment getCurrentFragment() {
List<Fragment> fragmentList = getSupportFragmentManager().getFragments(); return getSupportFragmentManager().findFragmentById(R.id.content_main);
if (fragmentList.size() > 0)
return fragmentList.get(fragmentList.size() - 1);
else
return null;
} }
public void hideActionBar() { public void hideActionBar() {