3

当用户按下电源按钮锁定屏幕时,我想继续我的 Android SpeechRecognizer 意图。

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

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

4

1 回答 1

0

没办法!锁屏后安卓系统会在5分钟内杀掉所有应用,除非你的应用加入了Wihte-list。或者,用户允许应用在后台运行

于 2016-11-03T05:01:39.417 回答