Reputation: 9394
I want to learn RXjava for android, so I have done the following:
1) I have downloaded the jar file of rxandroid-0.24.jar ,
rxandroid-framework-0.24.jar
2) added files to libs folder in android studio
3) add lib dependency to android studio, please check following
screenshot:
4) tried some code in my fragment and it doesn't seem to see rxandroid, please check following code:
import rx.Observable;
public class AboutFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Observable.from("one","two","three","four","five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.sobscribe(/* an Observer */);
}
I am using this tutorial https://github.com/ReactiveX/RxJava/wiki/The-RxJava-Android-Module
Can anyone please help and tell me what is missing here?
Upvotes: 0
Views: 2509
Reputation: 16394
You're missing the import for the Android schedulers; they're in a different package to the rest of RxJava:
import rx.android.schedulers.AndroidSchedulers;
Upvotes: 3