JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Speech recognition displays "Android.content.ActivityNotFoundException" on Android Vitals screen. I think SR is not installed in some devices, does not support it, turns it into crashes. What is best way avoiding this crash?
Error Log:
android.content.ActivityNotFoundException:
at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1861)
at android.app.Instrumentation.execStartActivity (Instrumentation.java:1534)
at android.app.Activity.startActivityForResult (Activity.java:4125)
at android.app.Activity.startActivityForResult (Activity.java:4072)
at com.myapp.MainActivity.CeviriBaslat (MainActivity.java:705)
at com.myapp.MainActivity.access$300 (MainActivity.java:110)
at com.myapp.MainActivity$7.onClick (MainActivity.java:549)
at android.view.View.performClick (View.java:5246)
at android.view.View$PerformClick.run (View.java:21256)
at android.os.Handler.handleCallback (Handler.java:739)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:145)
at android.app.ActivityThread.main (ActivityThread.java:6934)
at java.lang.reflect.Method.invoke (Native Method)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)
The Code:
private void CeviriBaslat() {
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
if (lang.equals("tur")){
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "tr-Tr");
i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Haydi birşey söyle!");
if (lang.equals("eng")){
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH
.toString());
i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Lets say something!");
startActivityForResult(i, check);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…