3 回答
![?](http://img1.sycdn.imooc.com/5458643d0001a93c02200220-100-100.jpg)
TA贡献1878条经验 获得超4个赞
您是否在服务和应用程序之间交换大量数据? 使用意图共享大量数据(例如,用户从图片库共享中选择大量文件,所选文件的URI将使用intents传输) 从服务接收位图文件 等待Android用大量数据进行响应(例如,当用户安装大量应用程序时,getInstalledApplications() 将applyBatch()与许多未完成的操作一起使用
当您得到此异常时,如何处理?
![?](http://img1.sycdn.imooc.com/545861b80001d27c02200220-100-100.jpg)
TA贡献1860条经验 获得超9个赞
TransactionTooLargeException
W/InputDispatcher( 2271): channel ~ Consumer closed input channel or an error occurred. events=0x9E/InputDispatcher( 2271): channel ~ Channel is unrecoverably broken and will be disposed!E/JavaBinder(28182): !!! FAILED BINDER TRANSACTION !!!
E/AndroidRuntime(28182): java.lang.RuntimeException: Adding window failed..E/AndroidRuntime(28182): Caused by: android.os.TransactionTooLargeException
case FAILED_TRANSACTION: ALOGE("!!! FAILED BINDER TRANSACTION !!!"); // TransactionTooLargeException is a checked exception, only throw from certain methods. // FIXME: Transaction too large is the most common reason for FAILED_TRANSACTION // but it is not the only one. The Binder driver can return BR_FAILED_REPLY // for other reasons also, such as if the transaction is malformed or // refers to an FD that has been closed. We should change the driver // to enable us to distinguish these cases in the future. jniThrowException(env, canThrowRemoteException ? "android/os/TransactionTooLargeException" : "java/lang/RuntimeException", NULL);
TransactionTooLargeOrAnotherReasonException
.
最新情况:/dev/zero
![?](http://img1.sycdn.imooc.com/5f33c0c90001f9ad05720572-100-100.jpg)
TA贡献1155条经验 获得超0个赞
TransactionTooLargeException
FragmentStatePagerAdapter
ViewPager
destroyItem()
FragmentStatePagerAdapter
private ArrayList<Fragment.SavedState> mSavedState = new ArrayList<Fragment.SavedState>();
FragmentStatePagerAdapter
@Overridepublic Parcelable saveState() { Bundle state = null; if (mSavedState.size() > 0) { state = new Bundle(); Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()]; mSavedState.toArray(fss); state.putParcelableArray("states", fss); } for (int i=0; i<mFragments.size(); i++) { Fragment f = mFragments.get(i); if (f != null && f.isAdded()) { if (state == null) { state = new Bundle(); } String key = "f" + i; mFragmentManager.putFragment(state, key, f); } } return state;}
FragmentStatePagerAdapter
Fragment.SavedState
TransactionTooLargeException
parcelableArray
saveState()
"states"
.
@Overridepublic Parcelable saveState() { Bundle bundle = (Bundle) super.saveState(); bundle.putParcelableArray("states", null); // Never maintain any states from the base class, just null it out return bundle;}
- 3 回答
- 0 关注
- 1474 浏览
添加回答
举报