I can't get startActivity() working in latest appium version

startActivity() is missing in appium java client 9.0.0, so unable to switch between application. Could you please assist me on this?

https://javadoc.io/doc/io.appium/java-client/latest/io/appium/java_client/android/StartsActivity.html

You are wrong. You just need cast AndroidDriver.

1 Like

It’s not working, please check the in below appium version.

io.appium java-client 9.0.0

I got the alternative way to switch the activity :

driver.executeScript(“mobile: startActivity”, ImmutableMap.of(“intent”, “com.google.android.youtube/com.google.android.apps.youtube.app.WatchWhileActivity”));

2 Likes

It is worked for me with this code

Also I tried before your code and it is also worked with Map
String intent = appstartPackage + “/” + appstartActivity;
Map<String, Object> params = new HashMap<>();
params.put(“intent”, intent);
driver.executeScript(“mobile: startActivity”, params);