community,
I'm programming in android and i have 2 classes, the mainactivity and a other class with a SpeechRecognizer(a listener). I want to give the activity a sign that the listener is done with listining, how can i do that? Should i extend the SpeechRecognizer-class with the mainActivity-class and then call a method from the mainActivity-class in the SpeechRecognizer-class? Here is a simplified version of my code to understand my problem:
thirst class:
puplic class mainActivity{
  onCreate(){
  speech.startListening();
}
}
second class:
pulbic class speech implements Recognizer{
   startListening(){
   //start the listener
   }
   @Override
   onResult(){
   //hear i get my string after a random various amount of time
   //(when the recognizer is done with hearing my stuff)
   //at this point i want to let the other class know, that im done here
   }
}
I hope you understand my problem, i think its an easy one, but i dont know a solution..
Greetings
 
    