[英]while calling get web service request Using Retrofit. “android.os.TransactionTooLargeException: data parcel size 1575704 bytes”
This is my code.这是我的代码。 I am simply calling get a request for my profile through the activity.我只是通过活动调用获取我的个人资料的请求。 And I got this error for that.我因此得到了这个错误。 when I comment the method call (Get Request method) it works fine and shows me my UI.当我评论方法调用(Get Request 方法)时,它工作正常并向我显示我的 UI。 but when calling it just showing a black screen with this recursive following response.但是当调用它时,它只显示一个带有这个递归跟随响应的黑屏。
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
Please help stuck here...请帮助卡在这里...
//Error //错误
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)
//Activity //活动
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.admin_profile_activity);
mAPIService = ApiUtils.getAPIService();
//method call
requestProfileDetail(LoginActivity.authTOken);
}
//method //方法
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 //request_Call_from_interface
@GET("getuserprofile")
Call<AdminProfileRequest> getDetails(@Header("Authorization") String
authToken);
I was having the same issue.我遇到了同样的问题。 After many many many tests, I finally found the cause: my model (the one used in method response, in your case AdminProfileRequest
) was implementing Parcelable
which internally I needed in other instances of my app.经过很多很多很多的测试,我终于找到了原因:我的模型(在方法响应中使用的一个,你的情况AdminProfileRequest
)正在实施Parcelable
在内部,我需要在我的应用程序的其他实例。 Removing that implementation (and implementing a work-around for passing data between activities/fragments) fixed the crash.删除该实现(并实现在活动/片段之间传递数据的变通方法)修复了崩溃。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.