Here is the code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if results = "google" (Uri.parse(url));
if (requestCode == check && resultCode == RESULT_OK){
ArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results));
}
super.onActivityResult(requestCode, resultCode, data);
} }
I need the results IF = “keyword” to open website, for now in quotes until I add database.
Again, don’t use
==to compare Strings. I’m not sure how to convince you of this fact, but it will often cause unexpected errors in your program. Again, useString#equals(...)orString#equalsIgnoreCase(...)methods.Please understand that == checks if the two objects are the same which is not what you’re interested in. The methods on the other hand check if the two Strings have the same characters in the same order, and that’s what matters here. So instead of
do,
or,