Created
October 29, 2018 04:45
-
-
Save prdpspkt/0f6454cf61f86236a336fd6ff3e765af to your computer and use it in GitHub Desktop.
Loading another fragment in Navigation Drawer Activity Dynamically.
This file contains 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
Fragment fragment = null; | |
Class fragmentClass = null; | |
fragmentClass = NoticeFragment.class; | |
try { | |
fragment = (Fragment) fragmentClass.newInstance(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
FragmentManager fragmentManager = getSupportFragmentManager(); | |
fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment