幸福别等,世事别怕!
ruffianzhong / rx-mvp Goto Github PK
View Code? Open in Web Editor NEWRxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
RxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
如题,能增加mvc的activity和franment
The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.reflect.UndeclaredThrowableException
知道什么原因吗?
我把GsonConverterFactory换成ScalarsConverterFactory会报错,而且还发现了你封装的解析出现int和double统一解析成后缀变为.0
如题!
我使用的华为Mate9,报错信息如下:
09-19 15:02:44.052 8694-8694/com.rx.mvp.cn E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.rx.mvp.cn, PID: 8694
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/networkbench/agent/impl/instrumentation/NBSEventTraceEngine;
at com.rx.mvp.cn.MainActivity.onClick(MainActivity.java)
at com.rx.mvp.cn.MainActivity_ViewBinding$1.doClick(MainActivity_ViewBinding.java:35)
at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22)
at android.view.View.performClick(View.java:5646)
at android.view.View$PerformClick.run(View.java:22459)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
您好,添加自定义的Interceptor在哪修改,比如token
比如业务需要,使用rxajva和rxandroid的来操作符实现网路请求轮询、网络请求嵌套回调(即在第1个网络请求成功后,继续再进行一次网络请求)等网络需求,应该怎样做,有思路不?
UserBiz这个业务逻辑是否可以放置到Model层?作者把UserBiz这个类当成业务逻辑数据处理类,和业务相关,是否可以封装成Model层?另外BaseActivity各种基类方法,是否可以提供传递View的方法也就是setContentView方法不传递xml文件 传递view 因为目前项目用的都是自定义控件 不支持xml方式
您好,请问一下在Demo的RHttpCallback判断token失效后如何跳转到LoginActivity呢?比如startActivty
switch (code) {
case 101://token过期,跳转登录页面重新登录(示例)
break;
case 102://系统公告(示例)
break;
default:
public interface HttpRequestListener {
void cancle();
}
如果说lifecycle.bindToLifecycle()是自动管理生命周期,那么使用lifecycle.bindUntilEvent(event)时 BasePresenter<V, T> implements LifeCycleListener不用具体实现什么吗
@Override
public T onConvert(String data) {
/**
* 接口响应数据格式如@Response
* 根据业务封装:
* 1. response.isSuccess() (code==0) 业务逻辑成功回调convert()=>onSuccess(),否则失败回调onError()
* 2.统一处理接口逻辑 例如:code==101 token过期等等
*/
T t = null;
Response response = new Gson().fromJson(data, Response.class);
int code = response.getCode();
String msg = response.getMsg();
JsonElement result = response.getResult();
switch (code) {
case 101://token过期,跳转登录页面重新登录(示例)
break;
case 102://系统公告(示例)
break;
default:
if (response.isSuccess()) {//与服务器约定成功逻辑
t = convert(result);
} else {//统一为错误处理
onError(code, msg);
}
break;
}
return t;
}
这有问题的,如果response.isSuccess()为false,执行onError了,最后还会执行onSuccess的,不合理啊
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.