Created
April 21, 2015 10:31
-
-
Save msomu/8a7dc67e63731f8d2843 to your computer and use it in GitHub Desktop.
This is used to find the number of fragments that are on the current activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onBackPressed() { | |
| //for testing purpose | |
| //returns the number of fragments on the Activity | |
| int count = fragmentManager.getBackStackEntryCount(); | |
| //displays the fragments that are present on the activity with their names | |
| for (int i=count-1;i>=0;i--){ | |
| String name = fragmentManager.getBackStackEntryAt(i).getName(); | |
| Config.l("Count :"+i+" name :"+name); | |
| } | |
| super.onBackPressed(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment