Keep the settings title as "Settings" even if launching a shortcut.

Handle clicks on Settings icon in top-left.
Also fix a bug where Tethering settings was changing the title.
This commit is contained in:
Amith Yamasani
2010-12-09 06:07:12 -08:00
parent 17e9e19330
commit 72aa19d1a5
3 changed files with 14 additions and 4 deletions

View File

@@ -49,8 +49,12 @@ public class Settings extends PreferenceActivity {
getMetaData(); getMetaData();
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// TODO: Do this only if 2-pane mode if (!onIsHidingHeaders() && onIsMultiPane()) {
highlightHeader(); highlightHeader();
// Force the title so that it doesn't get overridden by a direct launch of
// a specific settings screen.
setTitle(R.string.settings_label);
}
} }
@Override @Override

View File

@@ -131,6 +131,7 @@ public class TetherSettings extends SettingsPreferenceFragment {
mBluetoothSettings.setEnabled(false); mBluetoothSettings.setEnabled(false);
} }
} }
/* Don't change the title for two-pane settings
if (wifiAvailable && usbAvailable && bluetoothAvailable){ if (wifiAvailable && usbAvailable && bluetoothAvailable){
activity.setTitle(R.string.tether_settings_title_all); activity.setTitle(R.string.tether_settings_title_all);
} else if (wifiAvailable && usbAvailable){ } else if (wifiAvailable && usbAvailable){
@@ -146,6 +147,7 @@ public class TetherSettings extends SettingsPreferenceFragment {
} else { } else {
activity.setTitle(R.string.tether_settings_title_bluetooth); activity.setTitle(R.string.tether_settings_title_bluetooth);
} }
*/
mWifiApEnabler = new WifiApEnabler(activity, mEnableWifiAp); mWifiApEnabler = new WifiApEnabler(activity, mEnableWifiAp);
mView = new WebView(activity); mView = new WebView(activity);
} }

View File

@@ -216,8 +216,12 @@ public class ManageAccountsSettings extends AccountPreferenceBase
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == MENU_ADD_ACCOUNT) {
onAddAccountClicked(); onAddAccountClicked();
return true; return true;
} else {
return super.onOptionsItemSelected(item);
}
} }
private void setBackgroundDataInt(boolean enabled) { private void setBackgroundDataInt(boolean enabled) {