【问题标题】:How to prevent Google & Ask Alexa to open from MyApp如何阻止 Google 和询问 Alexa 从 MyApp 打开
【发布时间】:2021-02-25 09:48:12
【问题描述】:

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

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

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

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

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

【问题讨论】:

  • 你在使用动作语音指令吗?
  • @UsamaAltaf nop,我没有使用 ACTION_VOICE_COMMAND。

标签: android audio-recording android-bluetooth android-audiomanager google-now


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-16
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多