Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02bc31e7 authored by Brian Attwell's avatar Brian Attwell
Browse files

setSelectedHeader() when switching to fragment

Without this change, passing a EXTRA_SHOW_FRAGMENT value
for a two panel preferences activity will cause the correct
fragment to be shown. However, it will not cause the
correct header to be highlighted.

Bug: 15675746
Bug: 5045558
Change-Id: I18d8e15dd104e8f39ae1ccbb11ab17fd1bf7462e
parent e75b2c26
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1194,7 +1194,14 @@ public abstract class PreferenceActivity extends ListActivity implements
     * @param args Optional arguments to supply to the fragment.
     */
    public void switchToHeader(String fragmentName, Bundle args) {
        setSelectedHeader(null);
        Header selectedHeader = null;
        for (int i = 0; i < mHeaders.size(); i++) {
            if (fragmentName.equals(mHeaders.get(i).fragment)) {
                selectedHeader = mHeaders.get(i);
                break;
            }
        }
        setSelectedHeader(selectedHeader);
        switchToHeaderInner(fragmentName, args);
    }