Question

My current PreferenceActivity displays the HomeAsUp icon in the top left corner (I have not to explain you this left carret ;-) )

this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
this.getSupportActionBar().setIcon(R.drawable.ic_menu_preferences);

The big problems come when I use a "subpreference" screen like this:

<PreferenceCategory android:title="Detail Screens">
        <PreferenceScreen
            android:title="My Preference Screen"
            android:summary="The icon is sown in this page and that's great">
            <CheckBoxPreference
                android:title="This is an other screen"
                android:summary="Unfortunately, no custom icon or HomeAsUp here!."
            />
        </PreferenceScreen>

In the second screen, the default icon is shown with the the default title. How can I programatically set the icon and HomeAsUp?

I know I could create a second Activity (and that's what I plan to do if no answer) but it would really be better if I could keep only one preference screen.

Any idea // suggestion?

Was it helpful?

Solution

That's an Android bug!

https://code.google.com/p/android/issues/detail?id=4611

Sounds like I have to start a new Activity!

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