maoqitian / MaoWanAndoidClient

:rainbow:打造一款有较好体验的WanAndroid客户端,在学习中不断提升自我。同款跨平台Flutter版本:https://github.com/maoqitian/flutter_wanandroid
https://www.wanandroid.com/
Apache License 2.0
166 stars 36 forks source link

我按着你的LoginActivity写了个TestActivity,但是出现以下错误 #8

Closed EsZhangHome closed 5 years ago

EsZhangHome commented 5 years ago

image

java.lang.NullPointerException: Attempt to invoke interface method 'void mao.com.mao_wanandroid_client.presenter.test.TestsContract$TestView.showTestSuccess()' on a null object reference at mao.com.mao_wanandroid_client.presenter.test.TestPresenter$1.onSuccess(TestPresenter.java:60) at mao.com.mao_wanandroid_client.presenter.test.TestPresenter$1.onSuccess(TestPresenter.java:56) at mao.com.mao_wanandroid_client.model.http.control.BaseObserver.onNext(BaseObserver.java:30) at mao.com.mao_wanandroid_client.model.http.control.BaseObserver.onNext(BaseObserver.java:14) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252) at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109) at android.os.Handler.handleCallback(Handler.java:907) at android.os.Handler.dispatchMessage(Handler.java:105)

TestContract代码

/**

TestPresenter代码 /**

主TestActivity代码: /**

每次请求成功后,调用 mView.showTestSuccess(),而主TestActivity中的 @Override public void showTestSuccess() { Log.i("----------", Thread.currentThread().getName()); finish(); } 报错了,我不知道咋回事,能否指点迷津。。。。