in my project i am using voice recognition. i want to take the result of that class and pass it another class. But because this class is not an activity class, i cant use intent. the codes i use in voice recognition are like that:
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK){
ArrayList<String> matches = new ArrayList<String>();
matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
if(matches.size()>0) {
result = matches.get(0);}}
I want to take that result and use another class which is not an activity class. So please help me
You can declare you ArrayList as a static one like this,
By doing this you can access your ArrayList from anywhere by
where activity_name is the activity or class in which you declare the static ArrayList