Skip to content

Instantly share code, notes, and snippets.

@thilojaeggi
Created June 26, 2020 18:59
Show Gist options
  • Save thilojaeggi/9d717ad66bddec1a4b0c7d38b6901e3a to your computer and use it in GitHub Desktop.
Save thilojaeggi/9d717ad66bddec1a4b0c7d38b6901e3a to your computer and use it in GitHub Desktop.
String getCurrentFragment(){
Fragment visiblefragment = getSupportFragmentManager()
.findFragmentById(R.id.newusercontainer);
String[] currentFragment = visiblefragment.toString().split("\\{");
return currentFragment[0].toString();
}
@thilojaeggi
Copy link
Author

This allows you to get the FragmentName currently displayed in a certain container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment