I had created an android app which has several buttons on home page. And every button should load a secondary application where both are placed in different packages. For example, inside my app I had provided a button named 'Facebook', by clicking on that button it should load the 'Facebook' application that is running presently on the device.I had used intent function, but failed. Is this possible? Please reply
Asked
Active
Viewed 360 times
-3
-
1you need to know appropriate package name for the desired apps. – Amit K. Saha Apr 22 '15 at 11:08
-
please script some coding samples.. – Rahul Gopi Apr 22 '15 at 11:09
1 Answers
0
You need to know the exact package name & other info. For example, you can launch the Facebook app by -
Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);
N.B: finding package name of any published app is fairly easy https://play.google.com/store/apps/details?id=com.facebook.katana
but the you have to also know which is the launcher activity. you can find out this by unzipping apk file and then looking into the manifest file. but the problem is it might differ from version to version.

Amit K. Saha
- 5,871
- 2
- 27
- 35