-
Notifications
You must be signed in to change notification settings - Fork 18
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
RxJava的其他线程中可以进行UI操作吗? #1
Comments
ReactiveX/RxJava#3605 |
这个原因是什么?直是说更深一步的学习,有什么可以推荐的吗? |
Android要求UI操作必须在主线程中,但是不代表所有的地方都会检查。如果把UI操作放到别的线程,可能会抛出异常,也可能导致一些多线程的race condition。 |
这段代码的 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
observeOn(Schedulers.newThread())
.map(new Func1<Integer, String>() {
@OverRide
public String call(Integer integer) {
textView.setText(txt_thread_log.getText() + "\n" + "Schedulers.newThread() thread id =" + Thread.currentThread().getId());
return "5" + integer;
}
})
这其中的UI操作是在新的线程中操作吗,而且UI操作不是只能在主线程中操作吗?这搞得我好焦灼啊
The text was updated successfully, but these errors were encountered: