M
M
Michael Kim2016-08-08 19:28:57
Java
Michael Kim, 2016-08-08 19:28:57

Why can't the compiler recognize AndroidSheduler?

I want to work with observable in the main thread

qs
                .subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSheduler.mainThread())
                .map(cq -> cq.get(0))
                .subscribe(q ->
                        ((TextView) findViewById(R.id.title)).setText(q.getQTitle())
                );

But the IDE cannot recognize AndroidSheduler.mainThread () (can't resolve symbol), although without observeOn(AndroidSheduler.mainThread) and with a simple output to the console, everything works. What's the matter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tiberal, 2016-08-08
@Marox

AndroidSheduler.mainThread ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question