Open pratikbutani opened 11 years ago
hi, you need to learn more about fragments. check the android tutorial on fragmenttransaction
Hi, here is your code.
This is in the fragment of left menu, on click item. (I use listfragment)
getActivity().getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, new YourNewFragment())
.commit(); // R.id.content_frame is your main_activity.xml's main part. Give id = content_frame to root. And YourNewFragment is your new fragment class. If you want to know how, create a class, name it YourNewFragment.Extend it from Fragment. Then in its onCreateView method, inflate fragments own xml layout.
((BaseActivity) getActivity()).toggle();//Closes sliding content
How to switch Fragment when click on Sliding menu items, please help