我想在用户按下电源按钮锁定屏幕时继续我的 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/