在飞行模式下,按下按钮,输入屏幕出现一个声音,输入声音出现请在上周重新输入正常使用,谷歌找不到解决方案很长时间了,希望能救命 已设置离线谷歌语音
public void onclick1(View v)
{
Intent intent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,"請說");
startActivityForResult(intent,160);
}
protected void onActivityResult(int requestCode,int resultCode,Intent data) {
if(resultCode==RESULT_OK && requestCode==160){
super.onActivityResult(requestCode, resultCode, data);
ArrayList<String> text=data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
EditText tv=(EditText)findViewById(R.id.editText1);
tv.setText(text.toString());
}
}