Is it possible to open another application (like : BBM or LINE) when I click a button on my own application? Is there source code for this?
Asked
Active
Viewed 206 times
0
-
Search engines are your friends: http://stackoverflow.com/questions/3518407/android-starting-an-activity-for-a-different-third-party-app – mbmc Dec 12 '13 at 04:03
2 Answers
0
Yes, it's possible:
Intent intent = new Intent();
intent.setComponent(/** Component information of the target app. */);
startActivity(intent);

flx
- 14,146
- 11
- 55
- 70
-
what is parameter of Component information of the target app ? where can I get it if I want to open application BBM or LINE ? – Agoeng Liu Dec 12 '13 at 04:03
-
You need the package name and the class name of the app you want to open. package name is easy: it's listed in play store. class name is more tricky. but you can fetch it from `adb logcat` when starting the app. – flx Dec 12 '13 at 04:04
0
You can launch any application that is installed in your device using Intent
call from your application. Only thing you need is the Package name.
Intent sendIntent = getPackageManager().getLaunchIntentForPackage("package_name_for_corr_app");
startActivity(sendIntent);
We can get Package name in many ways. One possible way is by using DDMS. When starting an app inside a connected device or emulator, its package name will be shown inside Logcat. or you can browse for package names using DDMS->file explorer.

Nizam
- 5,698
- 9
- 45
- 57
-
-
Edited answer. One another way is using `PackageManager`. That will be irrelevant for you. – Nizam Dec 12 '13 at 05:26