diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/bluetooth/LocalBluetoothPreferences.java | 10 | ||||
-rw-r--r-- | src/com/android/settings/nfc/AndroidBeam.java | 16 |
2 files changed, 18 insertions, 8 deletions
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java b/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java index 36bc7c8..6f4a765 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java @@ -64,17 +64,17 @@ final class LocalBluetoothPreferences { return false; } + // If Bluetooth Settings is visible + if (manager.isForegroundActivity()) { + return true; + } + // If in appliance mode, do not show dialog in foreground. if ((context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_TYPE_APPLIANCE) == Configuration.UI_MODE_TYPE_APPLIANCE) { return false; } - // If Bluetooth Settings is visible - if (manager.isForegroundActivity()) { - return true; - } - long currentTimeMillis = System.currentTimeMillis(); SharedPreferences sharedPreferences = getSharedPreferences(context); diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java index bf02c13..032681a 100644 --- a/src/com/android/settings/nfc/AndroidBeam.java +++ b/src/com/android/settings/nfc/AndroidBeam.java @@ -38,6 +38,7 @@ public class AndroidBeam extends Fragment private ImageView mImageView; private NfcAdapter mNfcAdapter; private Switch mActionBarSwitch; + private CharSequence mOldActivityTitle; @Override @@ -49,7 +50,6 @@ public class AndroidBeam extends Fragment if (activity instanceof PreferenceActivity) { PreferenceActivity preferenceActivity = (PreferenceActivity) activity; - if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); mActionBarSwitch.setPadding(0, 0, padding, 0); @@ -59,8 +59,10 @@ public class AndroidBeam extends Fragment ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.END)); - activity.getActionBar().setTitle(R.string.android_beam_settings_title); - } + if (!preferenceActivity.onIsMultiPane() || preferenceActivity.onIsHidingHeaders()) { + mOldActivityTitle = getActivity().getTitle(); + activity.getActionBar().setTitle(R.string.android_beam_settings_title); + } } mActionBarSwitch.setOnCheckedChangeListener(this); @@ -76,6 +78,14 @@ public class AndroidBeam extends Fragment initView(mView); return mView; } + @Override + public void onDestroyView() { + getActivity().getActionBar().setCustomView(null); + if (mOldActivityTitle != null) { + getActivity().getActionBar().setTitle(mOldActivityTitle); + } + super.onDestroyView(); + } private void initView(View view) { mActionBarSwitch.setOnCheckedChangeListener(this); |