Open another one application from our application?

后端 未结 3 1648
旧巷少年郎
旧巷少年郎 2021-01-13 04:21

From my application i have to open a another one application.Is there any possibility to open like this?

3条回答
  •  情书的邮戳
    2021-01-13 05:08

    You can launch other applications with Activity.startActivity( intent);

    Use it like this:

    Intent intent = new Intent();
    String pkg = "com.android.browser";
    String cls = "com.android.browser.BrowserActivity";
    intent.setClassName(pkg, cls); 
    startActivity(intent);
    

    You need to know the package and class names of the activity to call, the Package Browser in the Dev Tools app will help here if its not your own app to call.

提交回复
热议问题