Fixes back button on action bar on some fragments.

SettingsPreferenceFragment has this already set so that the drawer
layout will work when the menu doesn't exist. However, some fragments
are not preference fragments, and we need to set setHasOptionsMenu
manually.

bug:27879503
Change-Id: I6faadeb56dab00af611ac413109800822038c66d
This commit is contained in:
Udam Saini
2016-03-28 16:35:13 -07:00
parent 1997f76cfc
commit 0708d9e119
10 changed files with 41 additions and 11 deletions

View File

@@ -20,7 +20,6 @@ import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
@@ -46,14 +45,13 @@ import android.widget.TextView;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import java.util.EnumSet;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
public class UserCredentialsSettings extends InstrumentedFragment implements OnItemClickListener {
public class UserCredentialsSettings extends OptionsMenuFragment implements OnItemClickListener {
private static final String TAG = "UserCredentialsSettings";
private View mRootView;