Button Btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Btn = (Button) findViewById(R.id.btn1); OnClickListener Btn = new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Select an application"); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); startActivityForResult(intent, SystemData.VOICE_RECOGNITION_REQUEST_CODE); } }; }
Stresses SystemData, why? How to fix?
Alt+Insert -> Import Class
tried? - Saidolim