初次使用RxAndroid + Retrofit
作者:
南柯好萌 | 来源:发表于
2016-06-28 17:07 被阅读0次Retrofit retrofit = new Retrofit.Builder() .baseUrl("http://lily.tvxio.com/") .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .client(HttpManager.getInstance().mClient) .build();HttpAPI.IpLookup ipLookup = retrofit.create(HttpAPI.IpLookup.class);ipLookup.doRequest(SimpleRestClient.device_token).subscribe(new Subscriber<IpLookUpEntity>() { @Override public void onCompleted() { Log.i(TAG, "fetchLocation: onCompleted"); } @Override public void onError(Throwable e) { Log.e(TAG, "fetchLocation: error"); } @Override public void onNext(IpLookUpEntity ipLookUpEntity) { initializeLocation(ipLookUpEntity); }});
本文标题:初次使用RxAndroid + Retrofit
本文链接:https://www.haomeiwen.com/subject/psptjttx.html
网友评论