Read Room database entity from a service android

By | October 30, 2018
Questions:

I’m trying to read a value from room database of android in a ListenerService class.

repository.responseCode("status");
        repository.responseCode("status").observe(
                MainActivity.class,flagValue -> {
                    if(flagValue!=null){

                    }
                }
        );

But it says wrong first type argument at “MainActivity.class” at above code.
Can I read any room db value from a service?

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *