Menu

null pointer exception help

Help
2011-10-13
2012-09-22
  • Alexander Alvarez Jurado

    hi, i have this code, and my problem is that when this function is called for
    the second time or third time i have a null pointer exception in this line:

    String bestResult = result.getBestFinalResultNoFiller();

    it so happens that result is null. What can i do to resolve this problem? so
    many thanks....

    this is the function:

    public String recognizeAndReport() throws GrammarException {
    String bestResult="";
    if(microphone.startRecording()){
    Result result = recognizer.recognize();
    bestResult = result.getBestFinalResultNoFiller();
    }
    microphone.stopRecording();
    microphone.clear();
    return bestResult;
    }

     
  • Nickolay V. Shmyrev

    Please avoid starting duplicated threads about the same problem. It will not
    help you to start 20 threads, it will only create a mess in this forum. Please
    continue discussion in previous thread.

     

Log in to post a comment.