1

So I'm using jfeinstein10's SlidingMenu, I have a blank main activity that setup a left panel menu in this way:

setContentView(R.layout.activity_main);

menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidthRes(R.dimen.shadow_width);
menu.setShadowDrawable(R.drawable.shadow);
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
menu.setFadeDegree(0.35f);

menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setMenu(R.layout.activity_fpricerca_addetti);

...on the OnCreate method. It works, it calls the XML correctly but I cant get how to call an Activity. In this case a ListActivity called FPRicercaAddetti that extends ListFragment.

I want to call the onCreate method of the other Activity when the left panel is sliding. Any ideas?

Thanks.

PS: another solution is to call the customization of the left panel in the same main activity, but I dont want to call all the stuff when the app starts, but only when the left panel is focused.

4

1 回答 1

0

一次只能运行一项活动。您不能将活动用作 SlidingMenu。

根据您的描述,我相信您想使用 Fragment。(库中包含片段使用演示)。

您可以在滑动菜单中放置一个片段(ListFragment),这将保持其所有代码自包含或简单地使用任何其他视图(例如 ListView)并像访问任何其他视图一样访问它。

于 2013-07-01T15:02:12.607 回答