speech recognition中使用PendingIntent
http://stackoverflow.com/questions/4530472/widget-that-calls-speech-recognition-app
http://stackoverflow.com/questions/6466328/recognizerintent-how-to-add-a-bundle-to-a-pending-intent
?
// this intent points to activity that should handle resultsIntent activityIntent = new Intent(context, ResultsActivity.class);// this intent wraps results activity intentPendingIntent resultsPendingIntent = PendingIntent.getActivity(context, 0, activityIntent, 0);// this intent calls the speech recognitionIntent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);voiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);voiceIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");voiceIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);voiceIntent.putExtra(RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT, resultsPendingIntent);// this intent wraps voice recognition intentPendingIntent pendingIntent = PendingIntent.getActivity(context, 0, voiceIntent, 0);rv.setOnClickPendingIntent(R.id.btn, pendingIntent);?