我正在使用改装2和rx java
情况:应用程序发送一些请求,然后我得到json格式的响应,自动转换为用户dto,然后在rx java的onNext方法中我收到用户列表.如果我从服务器收到这样的消息怎么办:{"error":"无法获取用户列表"}
如何通过改造2和rx来处理这种情况?
Subscription subscriptionBranches = model.getRepoBranches(owner, name)
.map(branchesMapper)
.subscribe(new Observer<List<Branch>>() {
@Override
public void onCompleted() {
;
}
@Override
public void onError(Throwable e) {
if (e instanceof retrofit.HttpException) {
HttpException exception = (HttpException) e;
}
showError(e);
}
@Override
public void onNext(List<Branch> list) {
branchList = list;
view.showBranches(list);
}
});
addSubscription(subscriptionBranches);
.....
@Override
public Observable<List<RepositoryDTO>> getRepoList(String name) {
return apiInterface
.getRepositories(name)
.compose(applySchedulers());
}
Run Code Online (Sandbox Code Playgroud) 有没有办法打开像http://www.mydomain.app.com这样的链接,这样 Safari 就会用我的 ios 应用程序打开它?我设法在android中做到了。
在 ios 中,我设法使用 plist 文件中的 URL 方案打开具有特殊方案的链接,例如 somecheme://。
但是如何打开特定域名的http链接呢?是否可以?
我的意思是,当您使用 www.domain.com/ 键入或打开一些 http url 时...系统建议使用我的应用程序打开它