我在 android 11 上使用字符串“com.android.camera.action.CROP”开始隐式裁剪意图。首次安装应用程序时无法通过此代码解析其活动。
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setType("image/*");
//to check whether there is an cropping app present or not
List<ResolveInfo> resInfoList = getPackageManager().queryIntentActivities(
intent, MATCH_DEFAULT_ONLY);
Run Code Online (Sandbox Code Playgroud)
它不是第一次解析,而是第二次运行,它获取可以处理意图的活动。