java - 从 "Complete action using"中删除我的应用程序

标签 java android

在我的应用程序中,我有两个按钮,一个是打开设备的相机,另一个是打开我的应用程序相机。我让用户可以选择他们想要使用的选项。

这是我打开设备摄像头的方式:

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/

相关文章:

android - ClassNotFoundException: 没有找到类 "android.support.design.widget.AppBarLayout"

android - 无论屏幕尺寸如何,如何确保布局看起来相同

java - Jackson - 递归解析为 Map<String, Object>

java - 涉及 Document 和 DocumentBuilder 的 JUnit 测试时验证错误

java - 如何在猜谜游戏中使用 JOption?

android - 有没有办法在 AsyncTask 中停止 HttpClient 的执行?

java - 从 Eclipse 生成的 Gradle 构建文件,出现错误 : Gradle version 1. 10 是必需的

android - Google 从 Android 登录并访问服务器的身份验证 token

java - NoNewLineParagraph 无法转换为 Element

java - Tomcat - 当应用程序未正确部署时如何获取 http 500 而不是 404?