Donald Wu
Donald Wu

Reputation: 718

Android Navigation Drawer change content

When I click navigation drawer items, how to make the page content change without creating or going to a new activity?

I don't want to use

Intent intent = new Intent(this, MyNextActivity.class);
startactivity(intent);

I want the page to stay here, not open a new page.

Any suggestions about how to do it?

Thanks.

Upvotes: 0

Views: 2261

Answers (1)

Kamran Ahmed
Kamran Ahmed

Reputation: 7761

You might want to go through the official documentation here: Creating a Navigation Drawer

You can change switch fragments on click of an item in the navigation drawer as explained here: Building a Dynamic UI with Fragments

The content_frame in the first tutorial can be treated as the fragment_container in this section of the second tutorial.

Upvotes: 2

Related Questions