Access Activity in Fragment when clicking on side menu item

时间:2015-06-26 10:21:44

标签: android

I am trying to build a side menu. How can I show an Activity in a Fragment when the user clicks on a side menu item? It's showing the Fragment when the user clicks on a side menu item. But it's not showing the Activity.

1 个答案:

答案 0 :(得分:0)

您可以使用LocalActivityManager在Fragment中实例化Activity,但在API 13(http://iamvijayakumar.blogspot.co.uk/2013/01/many-activity-inside-fragment-in-android.html)中已弃用。

如果你真的想要这样做,而不是仅按预期使用片段,请参阅此示例:{{3}}