From 1671fbbc9d8f58c35056fcb0bc61d58a7dc11f3a Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 23 Jul 2014 15:03:32 -0700 Subject: [PATCH] Show "up navigate" icon in input method subtype enabler Since API 16 (and API 14 with support library) and later, we started supporting "up navigation" model. http://developer.android.com/training/implementing-navigation/ancestral.html As a part of Settings app and a part of an IME's settings activity, the input method subtype enabler should have a "up navigate icon on its action bar. Bug: 16595009 Change-Id: Iaaadd970395b9c9254ab60b2e8fee22dffb8c7f6 --- .../InputMethodAndSubtypeEnablerActivity.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnablerActivity.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnablerActivity.java index b664540243b..bafae2bacaa 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnablerActivity.java +++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnablerActivity.java @@ -15,13 +15,31 @@ */ package com.android.settings.inputmethod; +import android.app.ActionBar; import android.content.Intent; +import android.os.Bundle; import com.android.settings.SettingsActivity; public class InputMethodAndSubtypeEnablerActivity extends SettingsActivity { private static final String FRAGMENT_NAME = InputMethodAndSubtypeEnabler.class.getName(); + @Override + protected void onCreate(final Bundle savedState) { + super.onCreate(savedState); + final ActionBar actionBar = getActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setHomeButtonEnabled(true); + } + } + + @Override + public boolean onNavigateUp() { + finish(); + return true; + } + @Override public Intent getIntent() { final Intent modIntent = new Intent(super.getIntent());