I have made research on google offline speech recognition. but it works fine in google nexus 5(OS:-4.4) but same build if I implement in Samsung galaxy s5(OS:-5.0) it is not
ERROR_RECOGNIZER_BUSY get thrown when you start your speech recognizer again when its already running. As in your code
case SpeechRecognizer.ERROR_RECOGNIZER_BUSY:
message = "RecognitionService busy";
Log.v("LOG_TAG", message);
speech.stopListening();
speech.destroy();
createSpeechAgain(VoiceRecognitionActivity.this);
break;
Simply edit your above code with
case SpeechRecognizer.ERROR_RECOGNIZER_BUSY:
break;
As there is no need to start it again it is already running. If you will start recognition again it will keep throwing same error. and it will go in loop.
ERROR_RECOGNIZER_BUSY is often thrown when you didn't close the SpeechRecognizer proprely. Yo probably are already using one instance of the SpeechRecognizer.
See this http://developer.android.com/reference/android/speech/SpeechRecognizer.html