Sorry, my mistake. Of course for settings it is better to use the
appropriate intent action.

But for many applications, the launcher intent is simply MAIN (in
category LAUNCHER), so there is no way to differentiate between
different applications, except by their component - right? (or is it
easily possible to specify the intent MAIN restricted to a specific
package? rather than specifying the full component?)

Peli
www.openintents.org

On Jul 2, 6:46 pm, Dianne Hackborn <[email protected]> wrote:
> Please don't hard-code component names of other packages.  Those are
> implementation details, and you can very well break at some point in the
> future.  The Settings class has a number of intent actions to launch
> standard settings panels; for other things, you should figure out the right
> intent protocol do you what you want.
>
>
>
> On Thu, Jul 2, 2009 at 9:32 AM, Peli <[email protected]> wrote:
>
> > If you are only interested in a specific application, you can study
> > the logcat output while launching that application. It will tell you
> > the component that is necessary to launch it.
>
> > Looking at the Settings manifest:
>
> >http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;...
>
> > I presume that the activity you want to launch is started by:
> > Intent i = new Intent();
> > i.setClassName("com.android.settings",
> > "com.android.settings.BatteryInfo");
> > startActivity(i);
>
> > or which settings did you want to launch?
>
> > Peli
> >www.openintents.org
>
> > On Jul 2, 5:48 pm, schwiz <[email protected]> wrote:
> > > well there a ton of battery life widgets out there but I just want a
> > > battery % widget that launches toggle settings for my convenience.  I
> > > just want to basically save a slot on my home screen. thanks for the
> > > link I'll take a look into it hopefully it will get me where I need to
> > > be.
>
> > > On Jul 2, 10:42 am, Peli <[email protected]> wrote:
>
> > > > First of all - what is the point of that widget? A user could simply
> > > > drag and drop the icon of the application they want to launch to the
> > > > home screen.
>
> > > > If you are still convinced you need it, you probably also want to
> > > > include an activity picker:http://www.openintents.org/en/node/263
>
> > > > On that page you find a small sample code how to start a
> > > > PICK_ACTIVITY.
>
> > > > The result is obtained in onActivityResult(). Using getComponentName()
> > > > you can retrieve the components that are required to launch the
> > > > desired application.
>
> > > > I hope this help.
>
> > > > Peliwww.openintents.org
>
> > > > On Jul 2, 4:32 pm, schwiz <[email protected]> wrote:
>
> > > > > Actually I can't even seem to find out how to do this with one of my
> > > > > own apps can anyone give me a code sample or point to some good
> > > > > documentation.  Ive read the actual android reference on intents and
> > > > > startActivity but I still can't figure it out.
>
> > > > > On Jul 1, 11:08 pm, schwiz <[email protected]> wrote:
>
> > > > > > I'm wanting to make a widget that launches an app another developer
> > > > > > made when you touch it.  I know you use the startActivity(intent)
> > > > > > meathod.  But I am wondering how I know what the intent is short of
> > > > > > emailing the developer and asking?
>
> --
> 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, and so won't reply to such e-mails.  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
-~----------~----~----~----~------~----~------~--~---

Reply via email to