I want to switch from app to chrome web browser and then navigate back to same app

public class switching {

public void openBrowser() throws MalformedURLException {

	DesiredCapabilities cap = new DesiredCapabilities();

	cap.setCapability("deviceName","One plus 5");
	cap.setCapability("udid", "9a0f2cfd");
	cap.setCapability("platformName", "Android");
	cap.setCapability("platformversion", "9.0.11");
	cap.setCapability("appPackage", "io.appium.android.apis");
	cap.setCapability("appActivity", "io.appium.android.apis.ApiDemos");
	URL url =new URL("");
	AndroidDriver driver= new AndroidDriver(url,cap);
	// after performing actions on app want to navigate to web browser


This is my code I want to switch to chrome broswer and then navigate back to same app