Question

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?

Was it helpful?

Solution

Turns out my problem had nothing to do with SlidingMenu. In my manifest I set all my Activitys to be singleInstance, so that I am not making multiple of the same Activity when I am navigating between them using the SlidingMenu. This was preventing the Intent that was created by PreferenceActivity when the Header was clicked from recreating the activity with the given fragment.

I removed the singleInstance reference for now and everything is working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top