Fragment side by side android

Sorry, my English is not good. How can I show fragments side by side so that when the user clicks a button in fragment A, fragment B is shown (80%)?

Upvotes: 0

Views: 657

Answers (3)

Robert Wildman
Robert Wildman

Reputation: 59

If you are looking to put a side menu in there that can be moved in and out you could try the Navigation Drawer by Google and it should do the job. Read about it here: Creating a Navigation Drawer

Upvotes: 1

root
root

Reputation: 23

I assume that you want to display a fragment on a button click. You can simply use replace function to replace the fragment on button click like this:

FragmentTransaction ft = getFragmentManager().beginTransaction();

ft.replace("layoutName",fragmentB)

Upvotes: 0

Related Questions