Launch Application

by bklik » Thu, 12 Mar 2009 20:21:40 GMT

Sponsored Links
 I want to basically create an application launcher.  How do do this?
Shouldn't the following just work?

        PackageManager pm = this.getPackageManager();
        List<ApplicationInfo> appList = pm.getInstalledApplications

        Intent i = new Intent();
        i.setClassName(appList.get(15).packageName, appList.get

It just crashes and I don't know why.


Launch Application

by bklik » Thu, 12 Mar 2009 23:45:46 GMT


OK, I can get my application to launch another application if I
explicitly type in the package and class names.  For example:

Intent i = new Intent();

Now, how to do find out what the Activity Name is for each package?  I
only guessed "Calculator" in the example above after a couple tries.
I also tried:


But, it returns null.



Sponsored Links

Launch Application

by Dianne Hackborn » Fri, 13 Mar 2009 02:59:15 GMT

 The is a home screen sample code in the SDK.  I would suggest using that
that to see how to do things.

Dianne Hackborn
Android framework engineer

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.


Launch Application

by bklik » Fri, 13 Mar 2009 19:14:10 GMT


Thank you for pointing me in that direction!  I found just what I was
looking for.

For those of you reading this thread, here's the code I used to get it

        PackageManager pm = this.getPackageManager();

        Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);

        List<ResolveInfo> appList = pm.queryIntentActivities
(mainIntent, 0);
        Collections.sort(appList, new ResolveInfo.DisplayNameComparator

        for(int i=0; i<appList.size(); i++){
                mainText.setText(mainText.getText() + "\n" +
                        "number: " + i + "\n" +
                        "Name: " + appList.get(i).loadLabel(pm) + "\n"
        Intent i = new Intent();
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
        i.setComponent(new ComponentName(appList.get
(4).activityInfo.applicationInfo.packageName, appList.get



launch application

by Dilli » Sat, 14 Mar 2009 22:03:55 GMT

 Hi all ,

I am developing a shoutcast(streaming) player,

it works fine..

I want to launch my player automatically if user clicks any shoutcast
link's in the browser.

How can i set my player as default player if user clicks on streaming
audio(.pls/m3u) links in the browser

Other Threads

1. Typography

Where can I find information on available typos on Android Devices?
And maybe something on best practices?



2. Mohon Pencerahan upgrade spica ke Froyo

SAlaaaaammm kawaaaandddd androiders.. from all brand.. :D

nanya spica lagi nih...

gmn nih status upgrade spica ke froyo.... udah fix bisa dan berjalan normal

mohon turotial fullll nyah,,,
link download nya juga...
pengen lebih ngebut lagi nih spica nyaaaa,,,, :D

Best Regards,
Puspa Bangun Subekti

"Indonesian Android Community [id-android]"

PING'S mobile
Email:  Ph. (021) 96087100
Yopie Ratjoen
Email:  Ph. 08977726681
Gila original
Email:  Ph. (031) 91555898

Aturan Jual/Kloteran ID-Android

3. Mau Beli and terima pre order JTA

4. SAP ABAP Interactive Online Training at

5. Buttons on Android Devices

6. Help : SG5 ngeHang

7. Animating different views during the same animation