ACTION_VIEW intent result
If I want to open file, passing it's URI in an intent and ACTION_VIEW
, but I don't know if there is 开发者_JAVA技巧app that supports such file, can I know whether file was opened or not?
public static boolean canIntentBeHandled(final Context ctx, final Intent intent) {
final List<ResolveInfo> info = ctx.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
return info.size() > 0;
}
精彩评论