I have a simple intent to run google maps navigation - it works really well. It automatically switches to bicycle mode and does not require any confirmation from user, just starts navigating. My code looks like this:
try {
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + lastPoint.latitude + "," + lastPoint.longitude + "&mode=b");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
} catch (Exception e) {
e.printStackTrace();
}
Now, how can I modify this intent to run navigation in picture-in-picture mode by default (ofc it must be available in the system and enabled for google maps app)? My app does not use PiP by itself, if it's your concern.