From c05dedf9bee2445b6a35e7ca2f2d67f9b570bfaa Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 12 Nov 2010 12:44:52 -0800 Subject: Buttons in battery details now switch fragments. These were launching a whole new settings activity. Change-Id: I6876acf54d484119eec339c8597b5d9d843bae56 --- .../settings/fuelgauge/PowerUsageDetail.java | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/com/android/settings/fuelgauge') diff --git a/src/com/android/settings/fuelgauge/PowerUsageDetail.java b/src/com/android/settings/fuelgauge/PowerUsageDetail.java index c4b6db477..771750394 100644 --- a/src/com/android/settings/fuelgauge/PowerUsageDetail.java +++ b/src/com/android/settings/fuelgauge/PowerUsageDetail.java @@ -42,8 +42,14 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; + +import com.android.settings.DisplaySettings; import com.android.settings.R; +import com.android.settings.SecuritySettings; +import com.android.settings.WirelessSettings; import com.android.settings.applications.InstalledAppDetails; +import com.android.settings.bluetooth.BluetoothSettings; +import com.android.settings.wifi.WifiSettings; public class PowerUsageDetail extends Fragment implements Button.OnClickListener { @@ -253,24 +259,30 @@ public class PowerUsageDetail extends Fragment implements Button.OnClickListener } private void doAction(int action) { + PreferenceActivity pa = (PreferenceActivity)getActivity(); switch (action) { case ACTION_DISPLAY_SETTINGS: - startActivity(new Intent(Settings.ACTION_DISPLAY_SETTINGS)); + pa.startPreferencePanel(DisplaySettings.class.getName(), null, + R.string.display_settings_title, null, null, 0); break; case ACTION_WIFI_SETTINGS: - startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); + pa.startPreferencePanel(WifiSettings.class.getName(), null, + R.string.wifi_settings, null, null, 0); break; case ACTION_BLUETOOTH_SETTINGS: - startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS)); + pa.startPreferencePanel(BluetoothSettings.class.getName(), null, + R.string.bluetooth_settings, null, null, 0); break; case ACTION_WIRELESS_SETTINGS: - startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)); + pa.startPreferencePanel(WirelessSettings.class.getName(), null, + R.string.radio_controls_title, null, null, 0); break; case ACTION_APP_DETAILS: startApplicationDetailsActivity(); break; case ACTION_SECURITY_SETTINGS: - startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS)); + pa.startPreferencePanel(SecuritySettings.class.getName(), null, + R.string.security_settings_title, null, null, 0); break; case ACTION_FORCE_STOP: killProcesses(); -- cgit v1.2.3