Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when using voice seach with async task .... #11

Open
ranaprathap2 opened this issue Jun 23, 2019 · 0 comments
Open

Issue when using voice seach with async task .... #11

ranaprathap2 opened this issue Jun 23, 2019 · 0 comments

Comments

@ranaprathap2
Copy link

ranaprathap2 commented Jun 23, 2019

on voice search i load the search term to another fragment and execute an async task that contains the following lines of code...... Upon entering doInBackground the app crashes with voice seach. But the normal search using text works anyways !

override fun doInBackground(vararg params: ArrayList<String>?): List<Contractor> {
if(params[0]==null){ // Program stop here and crashes
                Log.i("ViewContractsFragment","ArrayList is empty")
           }
}

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.servicetap, PID: 21895
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference
at com.michaelgarnerdev.materialsearchview.MaterialSearchView.onError(MaterialSearchView.java:1753)
at android.speech.SpeechRecognizer$InternalListener$1.handleMessage(SpeechRecognizer.java:451)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant