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
This commit is contained in:
Tadashi G. Takaoka
2014-07-23 15:03:32 -07:00
parent 1a77577da7
commit 1671fbbc9d

View File

@@ -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());