This is not a part of the SDK so don't be surprised if this breaks in a future release.
On Tue, Jan 20, 2009 at 2:02 PM, euroq <[email protected]> wrote: > > I'll answer my own question. > > ComponentName toLaunch; > toLaunch = new ComponentName("com.android.settings", > "com.android.settings.BatteryInfo"); > Intent intent = new Intent(Intent.ACTION_MAIN); > intent.addCategory(Intent.CATEGORY_LAUNCHER); > intent.setComponent(toLaunch); > intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK > | > Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); > context.startActivity(intent); > > > On Jan 20, 10:09 am, euroq <[email protected]> wrote: > > Hello all. > > > > I want to be able to show the Battery Info activity in my app, which > > shows things such as the exact level, battery health, etc.. This is > > an activity nested in the Settings of Android; the code is here: > > > > http://git.source.android.com/?p=platform/packages/apps/Settings.git;... > > > > I'm not sure how I can get it, though a few applications such as Power > > Manager, Any Cut, etc. show this screen as well. I found in the > > source code of Settings this intent in a file called > > testing_settings.xml: > > > > <PreferenceScreen > > android:title="@string/testing_battery_info"> > > <intent android:action="android.intent.action.MAIN" > > android:targetPackage="com.android.settings" > > > > android:targetClass="com.android.settings.BatteryInfo" /> > > </PreferenceScreen> > > > > But I don't know how to use it. I would guess from the fact that Any > > Cut has a list of activities, that a list of said activities exists > > somewhere, and therefore an easy way to access them exists, but I > > haven't found it. > > > > Thanks! > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

