I'm developing an application that gets input speech from the user and depending on the sentence, the video will work ... But the video only plays one video each time
public void onActivityResult(int request_code , int result_code , Intent i){
super.onActivityResult(request_code, result_code, i);
MediaController mediaController= new MediaController(this);
mediaController.setAnchorView(resultvid);
resultvid.setMediaController(mediaController);
CharSequence h1 = "hello";
CharSequence h2 = "i";
CharSequence h3 = "want";
CharSequence h4 = "water";
CharSequence h5 = "thank you";
switch (request_code){
case 100: if(result_code == RESULT_OK && i != null ){
ArrayList<String> result = i.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
resultTEXT.setText(result.get(0));
if (String.valueOf(result).contains(h1)) {
} else if (String.valueOf(result).contains(h2)) {
resultvid.setVideoPath("file:///storage/sdcard0/srtosl/me.mp4");
} else if (String.valueOf(result).contains(h3)) {
resultvid.setVideoPath("file:///storage/sdcard0/srtosl/want.mp4");
} else if (String.valueOf(result).contains(h4)) {
resultvid.setVideoPath("file:///storage/sdcard0/srtosl/water.mp4");
} else if (String.valueOf(result).contains(h5)) {
resultvid.setVideoPath("file:///storage/sdcard0/srtosl/thankyou.mp4");
}
resultvid.start();
break;
}
}
If the user inputs "I want water", I need all videos to play one by one. Thank you