how to add a project using library in another project. I've created 2 individual apps and now just wanted to add my second app into the first one in a way that the output should be like this: if i click a button from first app it will run my second app.
Asked
Active
Viewed 333 times
0
-
@Rasima, this might help -> https://stackoverflow.com/questions/2288440/how-to-create-a-java-application-which-can-be-run-by-a-click – Jay Dangar Dec 19 '18 at 06:25
-
I googled "open an app on button click android" and the first result was https://stackoverflow.com/questions/18937677/how-to-open-a-installed-android-app-with-a-button-click-intent – Rohit5k2 Dec 19 '18 at 06:25
-
This is not about adding a library but to open an app on button click – Rohit5k2 Dec 19 '18 at 06:26
-
https://stackoverflow.com/a/3343531/2633909 – DKV Dec 19 '18 at 06:32
1 Answers
0
You don't need to add any library to do that just put this code on your first app button click and add package name of your second app which you want to open, you will found that in the manifest file at the top like this "com.package.address".
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
if (launchIntent != null) {
try{
startActivity(launchIntent);
}catch(Exception e){
e.printStackTrace();
}
}

TheKarlo95
- 1,144
- 9
- 17

Tejas Soni
- 116
- 4