Code example for Bundle

Methods: containsKeygetFloatArray

0
 
    public static float[] getConfidenceFromDirect(Bundle bundle)
    { 
        float [] scores = null;
        if ((bundle != null)
                && bundle.containsKey(SpeechRecognizer.RESULTS_RECOGNITION))
        { 
            scores =
                bundle.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
        } 
        return scores;
    } 
 
    public static List<String> getHeardFromDirectPartial(Bundle bundle)
    { 
        List<String> results = new ArrayList<String>();
        if (bundle.containsKey(UNSUPPORTED_GOOGLE_RESULTS))
        { 
            String [] resultsArray =
                bundle.getStringArray(UNSUPPORTED_GOOGLE_RESULTS);
            results = Arrays.asList(resultsArray);
        } 
        else 
        { 
            return getHeardFromDirect(bundle);
        } 
        return results;
    } 
 
    public static float[] getConfidenceFromDirectPartial(Bundle bundle)
    { 
        float[] scores = null;
 
        if (bundle
                .containsKey(UNSUPPORTED_GOOGLE_RESULTS_CONFIDENCE))
        { 
            scores =
                    bundle.getFloatArray(UNSUPPORTED_GOOGLE_RESULTS_CONFIDENCE);
        } 
        else