2

we are trying to navigating from our Mobile App page to browser apps like chrome/firefox (using https url) Please find the below sample code.

My Sample Code: passing https url only.

Intent urlObjectIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlData));
startActivity(urlObjectIntent);

we have tested moto g40 and Samsung and other android mobiles os version 11 and 12 also. There is no issue on android mobiles navigating from app to outside of browser.

But, Particularly issue facing on only google pixel pro 6 mobile with OS Version 12. also, we don't have this pixel types of mobiles for development in hand.

This mobile is not allow to navigate from app to browser outside. also, we are getting the below warnings in pixel device, not for Samsung.

" No Intent available to handle action. "

Referred few stack pages also below.

No Activity found to handle Intent : android.intent.action.VIEW

https://medium.com/@idandamri/app-links-and-deep-links-with-android-12-765cf9bc9cca

  • is there any modification on intent calling to browsers?
  • if anything updated on android os 12 version level from google?
  • If yes, then, why its affecting for Pixel mobile only, not affect other mobiles. like Samsung
  • Please share me if any specific modification on Intent Call Action at android OS 12 versions. ex: google pixel pro 6 12 v

https://developer.android.com/training/app-links/deep-linking

https://developer.android.com/studio/write/app-link-indexing

any help on this. Thanks Advance.

harikrishnan
  • 1,985
  • 4
  • 32
  • 63

3 Answers3

0

As stated in the documentation, you have to check if there is an app installed on the device which is able to handle the action intent by using resolveActivity, it may not be the case :

https://developer.android.com/guide/components/intents-common#ViewUrl

public void openWebPage(String url) {
    Uri webpage = Uri.parse(url);
    Intent intent = new Intent(Intent.ACTION_VIEW, webpage);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
0
  • Better to check if you have those browsers installed in that device. If not then better install some browser.

  • If installed then, should verify the link "urlData" is correct with scheme, i.e "http://" or "https://".

  • Then can try with intent chooser.

    Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.stackoverflow.com"));

    // Always use string resources for UI text. This says something like "Share this photo with" String title = getResources().getText(R.string.chooser_title); // Create and start the chooser Intent chooser = Intent.createChooser(intent, title); startActivity(chooser);

Reference : How to open links in Android app in external browser?

0

we are targeting our app to Android 12 with API 31. so, as per latest android os 11,12 restriction intent access,

some of the installed apps are visible and few are not visible.

so, we have to add the query to access that particular app package in manifest file, which is not able to access in our app.

more details available in below android developer link:

Android Developer Link

Note: If your app targets Android 10 (API level 29) or lower, all apps are visible to your app automatically.

harikrishnan
  • 1,985
  • 4
  • 32
  • 63