【发布时间】:2018-08-06 05:25:30
【问题描述】:
我正在尝试“破坏”“ACTION_RECOGNIZE_SPEECH”意图...
public void getSpeech(View view){
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
...
@Override
public void onDestroy() {
// prevent memory leaks when activity is destroyed
....stopListening();
....cancel();
intent.destroy();
intent. getInstance().shutdown();
super.onDestroy();
【问题讨论】:
-
你想做什么?不保证会调用 onDestroy()。如果您需要在应用程序置于后台时进行一些清理,请根据您的目标 Api 在 onStop 或 onPause 中进行。
标签: android android-intent symbols destroy speech