Tamicer / Novate

A safety client by Https for android, (Android网络框架,基于Retrofit和RxJava打造的链式网络库, 支持okhttp的调用风格,又兼容Retrofit API,并支持rxJava链式操作)
Apache License 2.0
1.43k stars 268 forks source link

maps 为 null #85

Closed zouxianbincc closed 6 years ago

zouxianbincc commented 6 years ago

new Novate.Builder(context) .baseUrl(Urls.SERVER) .addCache(false) .build() .rxGet("/Tag/GetProTypeList", new RxStringCallback() {

                @Override
                public void onStart(Object tag) {
                    super.onStart(tag);
                }

                @Override
                public void onNext(Object tag, String response) {
                }

                @Override
                public void onError(Object tag, Throwable e) {
                }

                @Override
                public void onCancel(Object tag, Throwable e) {
                }
            });

报错 maps 为 null

Caused by: java.lang.NullPointerException: maps is not null! at com.tamic.novate.Novate.rxGet(Novate.java:332) at com.tamic.novate.Novate.rxGet(Novate.java:289) at com.example.zouxianbin.inm_admin.ui.barcode.test.a(test.java:18) at com.example.zouxianbin.inm_admin.ui.barcode.BarCodePresenter.getProTypeData(BarCodePresenter.java:133) at com.example.zouxianbin.inm_admin.ui.barcode.BarCodePresenter.attachView(BarCodePresenter.java:69) at com.example.basicslibrary.mvp.BaseFragment.initPresenter(BaseFragment.java:60) at com.example.basicslibrary.mvp.BaseFragment.onActivityCreated(BaseFragment.java:53) at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2355) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1451) at android.support.v4.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2617) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2388) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2344) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3248) at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200) at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2361) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1451) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3244) at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200) at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597) at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1254) at android.app.Activity.performStart(Activity.java:6930) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2767) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2875)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:156)  at android.app.ActivityThread.main(ActivityThread.java:6623)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)  2018-07-17 10:32:25.862 690-1197/? I/logserver: handle_logfile_events, Object Path:/data/system/dropbox/, mask=0x00000080

Tamicer commented 6 years ago

@zouxianbincc 加一个空的map

new Novate.Builder(context)
.baseUrl(Urls.SERVER)
.addCache(false)
.build()
.rxGet("/Tag/GetProTypeList", new Map(), new RxStringCallback() {

                @Override
                public void onStart(Object tag) {
                    super.onStart(tag);
                }

                @Override
                public void onNext(Object tag, String response) {
                }

                @Override
                public void onError(Object tag, Throwable e) {
                }

                @Override
                public void onCancel(Object tag, Throwable e) {
                }
            });