如何阻止 Google & Ask Alexa 从 MyApp 打开

问题描述

我正在通过蓝牙耳塞录制音频。当用户按住按钮时,应用程序会记录来自蓝牙耳塞的音频/语音,工作正常。

问题:当用户按住按钮时,有时会出现 Open with 弹出窗口,要求打开 Google or Ask Alexa 应用程序。 (附上截图以便更好理解)

  • 我们如何防止此 open with 弹出窗口出现在我们的应用中?
  • 我需要在 intent-filter 文件中添加/更新任何 manifest 吗?
  • 我需要在 audiomanager 中更改模式吗?

对蓝牙音频使用以下代码:

audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
audioManager.startBluetoothSco();
audioManager.setBluetoothScoOn(true);

enter image description here

enter image description here

解决方法

在活动的清单中使用 android:exported="false"

<activity android:name=com.mymundane.app.MainActivity" 
    android:exported="false">
</activity>

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...