在我的应用程序中,我有两个按钮,一个是打开设备的相机,另一个是打开我的应用程序相机。我让用户可以选择他们想要使用的选项。
这是我打开设备摄像头的方式:
Uri videoUri = FileProvider.getUriForFile(this, getApplicationContext().getPackageName() + ".provider", filePlusName);
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
startActivityForResult(intent, VIDEO_REQUEST_CODE);
将会出现一个“弹出窗口”,要求我选择一个相机应用程序 - 使用完成操作
。
问题是我的应用程序相机是选项之一。我想从此选项中删除我的应用程序的相机。
是否可以从使用
弹出窗口完成操作中删除我的应用程序?
最佳答案
检查 AndroidManifest。我认为您的应用程序 Activity 之一已注册以执行捕获 Intent 操作。
查找这些 Intent 操作 - 如果存在,请将其删除 -
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.VIDEO_CAMERA"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
关于java - 从 "Complete action using"中删除我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56696938/