The question in the title. How? Had tried

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.trim())); intent.setDataAndType(Uri.parse(url.trim()), "application/com.mxtech.videoplayer.pro|application/com.mxtech.videoplayer.ad"); PackageManager packageManager = getContext().getPackageManager(); List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0); if (activities.size() > 0) { getContext().startActivity(intent); }else { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url.trim())); List<ResolveInfo> a = packageManager.queryIntentActivities(i, 0); Log.d("download", title + " " + url); if (a.size() > 0) getContext().startActivity(intent); } 

In addition to mx, dvget also offers even if I click remember

    1 answer 1

    Simply specifying the mime type will not help - applications subscribe to everything.
    You need to explicitly specify the package and target activation.

     Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.trim())); intent.setDataAndType(Uri.parse(url.trim()), "application/com.mxtech.videoplayer.pro|application/com.mxtech.videoplayer.ad"); PackageManager packageManager = getContext().getPackageManager(); List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0); if (activities.size() > 0) { boolean started = false; for (ResolveInfo info : activities) { ActivityInfo activityInfo = info.activityInfo; if (activityInfo.packageName.startsWith("com.mxtech.videoplayer")) { getContext().startActivity(intent.setClassName(activityInfo.packageName, activityInfo.name)); started = true; break; } } if (!started) getContext().startActivity(intent); }