javaandroidandroid-roomvoice-recognitionrecognizer-intent

Android speech Recognition not working with Room database query


Room Entity's data is stored but it's object is always null.

@Override public void onResults(Bundle bundle) {

    ArrayList<String> list = bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
    String string = list.get(0);
    new Thread(new Runnable() {
        @Override
        public void run() {
            EntityClass entityClass = roomdb.roomdao().loadatbyname(list.get(0));
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    textview.settext(entityClass.getName());
                }
            });
        }
    }).start();

Solution

  • Room Entity's data is stored but it's object is always null.