android - 如何在待机状态下运行 Android 进程?

标签 android speech-recognition android-wake-lock recognizer-intent

我想在用户按下电源按钮锁定屏幕时继续我的 Android SpeechRecognizer Intent 。

public abstract class ListeningActivity {
    protected SpeechRecognizer sr;
    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    sr.startListening(intent);

但目前,当锁定显示时,进程会停止。如何正确继续 SpeechRecognizer?

最佳答案

不可能!当你锁定显示时,android系统将在5分钟内杀死所有应用程序,除非你的应用程序加入Wihte-list。或者,用户允许应用程序在后台运行

关于android - 如何在待机状态下运行 Android 进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40393566/

相关文章:

android - 我需要唤醒锁才能通过网络发送数据吗?

java - WakeLock并不总是释放

android - 如何在 Android 上使用 IAM 或 Cognito Pool 作为身份验证方法而不是 API key

android - 在 Android 中创建较小的标签

Android DialogPreference 布局 TextSize

android - 如何在 Youtube Android API 中禁用字幕?

python - 语音识别包(https ://pypi. org/project/SpeechRecognition/)可以离线工作吗?

c# - Microsoft 语音识别 - 我必须添加什么引用?

javascript - 使用 Javascript 的谷歌云语音

android - 手机休眠时不会调用 onMessageReceived