开发者

ACTION_VIEW intent result

开发者 https://www.devze.com 2023-03-15 03:24 出处:网络
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 stati

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消