• Scenario: 拍完照要選擇開哪一個照片 app; 聽音樂要選哪一個播放器...

  • Step:

  1. 取得列表
  2. 開啟

Ref: Open another application from your own (intent)

/** Open another app.
 * @param context current Context, like Activity, App, or Service
 * @param packageName the full package name of the app to open
 * @return true if likely successful, false if unsuccessful
public static boolean openApp(Context context, String packageName) {
    PackageManager manager = context.getPackageManager();
    try {
        Intent i = manager.getLaunchIntentForPackage(packageName);
        if (i == null) {
            return false;
            //throw new PackageManager.NameNotFoundException();
        return true;
    } catch (PackageManager.NameNotFoundException e) {
        return false;


openApp(this, "com.google.android.maps.mytracks");


comments powered by Disqus
Copyright © 2013 Andro Chen
Powered by Logdown and Greyshade
Favicon from The Noun Project