Commits

Anonymous committed b11ef17

BUGFIX Crash on tablet devices on launch

By default, Android expects the first header to point to a fragment so
on multi-pane (eg, tablet) devices, it will have a fragment to open in
the right pane. We failed to specify a fragment or change the default
behavior.

Fixed by overriding onGetInitialHeader() to return a dummy Header with a
fragment pointing to the SELinuxEnforcingFragment. On multi-pane
devices, SEAdmin will open with the Enforcing Fragment on the right
side. On single-pane devices (handsets), behavior is not changed.

  • Participants
  • Parent commits d985e1c

Comments (0)

Files changed (1)

src/com/android/seandroid_admin/SEAndroidAdminActivity.java

         //TODO maybe enable or disable headers here based on whether were device admin?
     }
 
+    @Override
+    public PreferenceActivity.Header onGetInitialHeader() {
+        Header h = new PreferenceActivity.Header();
+        h.fragment = SELinuxEnforcingFragment.class.getCanonicalName();
+        return h;
+    }
+
     private static class HeaderViewHolder {
         TextView title;
         Switch switch_;