Quantcast
Viewing latest article 27
Browse Latest Browse All 42

Answer by Mr.Goomer for OnClick Fragment Transactions Does Nothing

So I notice that when I press the button and open the drawer,the fragment is showing but next to drawer item. So I changed R.id.navMemories to drawer_layout and now its displaying

the final code:

        // Create new fragment and transaction        FragmentManager fragmentManager = getActivity().getSupportFragmentManager();        GalleryFragment galleryFragment = new GalleryFragment();        FragmentTransaction transaction = fragmentManager.beginTransaction();        transaction.setReorderingAllowed(true);        transaction.addToBackStack(null);        // Replace whatever is in the fragment_container view with this fragment        transaction.replace(R.id.drawer_layout, galleryFragment, null);        // Commit the transaction        transaction.commit();

Viewing latest article 27
Browse Latest Browse All 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>