6 package com.google.appinventor.components.runtime;
8 import android.app.Activity;
9 import android.content.Intent;
10 import android.speech.RecognizerIntent;
12 import java.util.ArrayList;
17 private String result;
19 private Intent recognizerIntent;
23 private int requestCode;
26 this.container = container;
27 this.recognizerIntent = recognizerIntent;
32 if(requestCode == 0) {
35 container.
$context().startActivityForResult(recognizerIntent, requestCode);
45 if (requestCode == this.requestCode && resultCode == Activity.RESULT_OK) {
46 if (data.hasExtra(RecognizerIntent.EXTRA_RESULTS)) {
47 ArrayList<String> results = data.getExtras().getStringArrayList(RecognizerIntent.EXTRA_RESULTS);
48 result = results.get(0);