Search in sources :

Example 1 with Worker

use of com.codez.collar.worker.Worker in project Collar by CodeZsx.

the class UserManager method initUserInfo.

public void initUserInfo() {
    Log.i(TAG, "initUserInfo");
    if (worker == null) {
        worker = new Worker();
        worker.initilize(TAG + " work!");
    }
    HttpUtils.getInstance().getUserService().getUserInfo(AccessTokenKeeper.getInstance().getUid(), null).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<UserBean>() {

        @Override
        public void onCompleted() {
        }

        @Override
        public void onError(Throwable e) {
            Log.w(TAG, "onError:" + e.toString());
        }

        @Override
        public void onNext(UserBean userBean) {
            Log.i(TAG, "onNext");
            userMe = userBean;
            sendUpdateUserInfoEvent();
        }
    });
}
Also used : UserBean(com.codez.collar.bean.UserBean) Worker(com.codez.collar.worker.Worker)

Aggregations

UserBean (com.codez.collar.bean.UserBean)1 Worker (com.codez.collar.worker.Worker)1