0

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?

tshepang
  • 11,360
  • 21
  • 88
  • 132
Agoeng Liu
  • 674
  • 3
  • 9
  • 29
  • 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 Answers2

0

Yes, it's possible:

Intent intent = new Intent();
intent.setComponent(/** Component information of the target app. */);
startActivity(intent);
flx
  • 14,016
  • 11
  • 53
  • 69
  • 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,616
  • 9
  • 43
  • 56