How to switch from one native app to another native in between execution in local?
Posted on April 1, 2019
By Shibu Panda
Code Snippet:
// App1 capabilities
String AppPackageName = "io.cloudgrey.the_app";
String AppActivityName = "io.cloudgrey.the_app.MainActivity";
// App2 capabilities
String PcloudyDemoAppPackageName = "com.pcloudy.appiumdemo";
String PcloudyDemoAppActivityName = "com.ba.mobile.LaunchActivity";
//Lunch App1
Activity activity = new Activity(AppPackageName, AppActivityName);
activity.setStopApp(false);
((AndroidDriver < MobileElement > ) driver).startActivity(activity);
//Lunch APP2
Activity activity = new Activity(PcloudyDemoAppPackageName, PcloudyDemoAppActivityName);
activity.setStopApp(false);
((AndroidDriver < MobileElement > ) driver).startActivity(activity);