2016-10-22 154 views
-1

當我單擊導航抽屜項目時,如何更改頁面內容而不創建或轉到新活動?Android導航抽屜更改內容

我不想使用

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

我想要的頁面留在這兒,而不是打開新的一頁。

有關如何操作的建議?

謝謝。

+3

我相信你正在尋找有碎片的導航抽屜。檢查這個鏈接如何創建一個片段。 https://guides.codepath.com/android/Fragment-Navigation-Drawer 或者只是搜索帶有碎片的導航抽屜。 – jlively

+0

你需要爲此使用片段。你可以檢查一個簡單的例子,像這樣http://v4all123.blogspot.in/2014/05/simple-navigation-drawer-example-in.html – Sourabh

回答