0

I have been successfully using HoloEverywhere's PreferenceActivity for a while. I am now importing the SlidingMenu library and has been going well so far until I extended SlidingMenu's SlidingPreferenceActivity:

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingPreferenceActivity;

public class SettingsActivity extends SlidingPreferenceActivity{
...

and

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import org.holoeverywhere.preference.PreferenceActivity;

public class SlidingPreferenceActivity extends PreferenceActivity implements
        SlidingActivityBase {
...

In my SettingsActivity I load some Header's to show the top level categories.

My problem is now onHeaderClick() is no longer working. I trace it all the way through and cannot find the error. Following the stack trace I see HoloEverywhere ends up making an Intent it eventually passes to the Android Activity, but I don't see anything that is obviously wrong.

What about the SlidingMenu Library could cause Fragments to stop working in a PreferenceActivity?

4

1 回答 1

0

原来我的问题与SlidingMenu. 在我的清单中,我将所有我Activity的 s 设置为singleInstance,这样Activity当我使用SlidingMenu. 这可以防止单击时Intent创建的 使用给定片段重新创建活动。PreferenceActivityHeader

我现在删除了singleInstance参考,一切正常。

于 2013-08-23T21:01:58.517 回答