I have three existing apps. Now i want to combine all the three into single app. Say i have three button, when i click button 1 then app 1 should run. And when button 2 is clicked app 2 should run. Is it possible in android studio? have have tried searching but nothing helped.

- 87
- 1
- 9
-
http://stackoverflow.com/questions/3422758/start-application-knowing-package-name – Soo Chun Jung Apr 26 '17 at 05:11
3 Answers
From this SO start application knowing package name. Just use these two lines you can launch any installed application whose package name
is known:
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.example.abc");
startActivity( LaunchIntent );
for the unknown package name
PackageManager pm;
pm = getPackageManager();
// get a list of installed apps.
packages = pm.getInstalledApplications(0);

- 1
- 1

- 1,071
- 11
- 27
I'm going to preface this by saying I do not have any experience with Android Studio. Hopefully it bears some resemblance with its terribly simplified counterpart App Inventor.
Anywho, I would create an independent main screen (activity?) that has 3 buttons on it and paste the three existing apps' code into other screens in the same app. Each button would open its corresponding screen/app through opening a new activity.

- 314
- 2
- 13
Got the solution. I just converted the three applications to library and imported them into the main app. Now i can call any activity from any of the three app any time as required. While using package manage all the three apps would have to be installed separately. Thank you coder and himty for sparing some time to answer my question. But still i have a problem. I am actually working on watch faces. Even though i can launch any activity, i still can't change the watch face. Tried Wallpaper but we can only open the face picker & cannot set the watch face.
ComponentName unique=new ComponentName(MainActivity.this,BlackOwlBlue.class);
Intent i=new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER)
.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,unique)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);

- 87
- 1
- 9