이 코드를 ? this
이 활동의 맥락으로하여 listener
인스턴스를하지 다스 려하기 때문에활동 및 음성 인식
public void onResults(Bundle results) {
str = new String();
Log.d(TAG, "onResults " + results);
ArrayList<String> data = results
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
for (int i = 0; i < data.size(); i++) {
Log.d(TAG, "result " + data.get(i));
str += data.get(i);
}
Intent intent = new Intent();
Bundle b = new Bundle();
b.putString("StrID", str);
intent.putExtras(b);
intent.setClass(this, SecondActivity.class);
startActivity(intent);
}
무엇이 오류입니까? 예외의 스택 추적을 추가하고 매니페스트 파일에서 SecondActivity를 선언했는지 확인하십시오. – Houcine
** 오류 : ** Intent 유형의 setClass (Context, Class >) 메소드는 인수에 적용 할 수 없습니다 (VoiceActivity.listener , Class) –
monomi
= 내 대답 참조 :) – Houcine