开发者

what is the android exception that best fits this scenario?

开发者 https://www.devze.com 2023-02-19 08:40 出处:网络
PackageManager pm = context.getPackageManager(); List<ResolveInfo> apps = pm.queryIntentActivities(viewDocIntent, PackageManager.MATCH_DEFAULT_ONLY);
PackageManager pm = context.getPackageManager();
List<ResolveInfo> apps = 
    pm.queryIntentActivities(viewDocIntent, PackageManager.MATCH_DEFAULT_ONLY);

if (apps.size() &开发者_Python百科gt; 0)
    context.startActivity(viewDocIntent);
else
    throw new ... SOMETHING

Which exception would you think should be thrown if the resulting list is empty?


ActivityNotFoundException.

0

精彩评论

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