【发布时间】:2018-11-11 15:48:12
【问题描述】:
这是我的代码。我只是通过活动调用获取我的个人资料的请求。我得到了这个错误。当我评论方法调用(获取请求方法)时,它工作正常并向我显示我的 UI。但是当调用它时,它只会显示一个带有递归跟随响应的黑屏。
I/art: Background sticky concurrent mark sweep GC freed 8216(299KB) AllocSpace objects, 0(0B) LOS objects, 14% free, 93MB/109MB, paused 5.381ms total 19.009ms
请帮忙卡在这里...
//错误
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1575704)
E/AndroidRuntime: Error reporting crash
android.os.TransactionTooLargeException: data parcel size 1575704 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4480)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:90)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
//活动
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.admin_profile_activity);
mAPIService = ApiUtils.getAPIService();
//method call
requestProfileDetail(LoginActivity.authTOken);
}
//方法
private void requestProfileDetails(String authoken){
mAPIService.getProfileDetails(authoken).enqueue(new
Callback<AdminProfileRequest>() {
@Override
public void onResponse(Call<AdminProfileRequest> call,Response<AdminProfileRequest> response) {
if(response.isSuccessful()) {
Log.d("Name","Name ");
}else{
Log.d("response", "code = " + response.code());
Log.d("response: ","boyd= "+response.body());
APIError error = ErrorUtils.parseError(response);
Log.d("error message", ""+error.message());
}
}
@Override
public void onFailure(Call<AdminProfileRequest> call, Throwable t) {
}
});
}
//request_Call_from_interface
@GET("getuserprofile")
Call<AdminProfileRequest> getDetails(@Header("Authorization") String
authToken);
【问题讨论】:
标签: android retrofit2 uncaught-exception get-request