public void findMatch ( ArrayList < String > speechResult ) { loadCadidateString ( ) ; for ( String matchCandidate : speechResult ) { Locale localeDefault = mGvrContext . getActivity ( ) . getResources ( ) . getConfiguration ( ) . locale ; if ( volumeUp . equals ( matchCandidate ) ) { startVolumeUp ( ) ; break ; } else if ( volumeDown . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startVolumeDown ( ) ; break ; } else if ( zoomIn . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startZoomIn ( ) ; break ; } else if ( zoomOut . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startZoomOut ( ) ; break ; } else if ( invertedColors . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startInvertedColors ( ) ; break ; } else if ( talkBack . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { enableTalkBack ( ) ; } else if ( disableTalkBack . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { disableTalkBack ( ) ; } } }
get the result speech recognize and find match in strings file .