I am trying to find the default app that will handle a type of intent. For example find the web browser that will handle all the links when there are multiple browsers installed. I found some Java code to do that:
Get Preferred/Default app on Android - Stack Overflow
I need to find the package name of the default app. Can someone please translate this code to B4A?
Get Preferred/Default app on Android - Stack Overflow
B4X:
Intent i = (new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com"));
PackageManager pm = context.getPackageManager();
final ResolveInfo mInfo = pm.resolveActivity(i, 0);
Toast.makeText(context, pm.getApplicationLabel(mInfo.activityInfo.applicationInfo), Toast.LENGTH_LONG).show();
I need to find the package name of the default app. Can someone please translate this code to B4A?