阅读更多

 

 


android intent 最大传送内容 1m_第1张图片
 

如果Binder的参数或返回值太大,不适合的事务缓冲区,然后调用将失败,并将被抛出TransactionTooLargeException

 

参考:http://developer.android.com/reference/android/os/TransactionTooLargeException.html

 

 

The Binder transaction failed because it was too large.

During a remote procedure call, the arguments and the return value of the call are transferred as Parcel objects stored in the Binder transaction buffer. If the arguments or the return value are too large to fit in the transaction buffer, then the call will fail and TransactionTooLargeException will be thrown.

The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size.

There are two possible outcomes when a remote procedure call throws TransactionTooLargeException. Either the client was unable to send its request to the service (most likely if the arguments were too large to fit in the transaction buffer), or the service was unable to send its response back to the client (most likely if the return value was too large to fit in the transaction buffer). It is not possible to tell which of these outcomes actually occurred. The client should assume that a partial failure occurred.

The key to avoiding TransactionTooLargeException is to keep all transactions relatively small. Try to minimize the amount of memory needed to create aParcel for the arguments and the return value of the remote procedure call. Avoid transferring huge arrays of strings or large bitmaps. If possible, try to break up big requests into smaller pieces.

If you are implementing a service, it may help to impose size or complexity contraints on the queries that clients can perform. For example, if the result set could become large, then don't allow the client to request more than a few records at a time. Alternately, instead of returning all of the available data all at once, return the essential information first and make the client ask for additional information later as needed

 

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。


android intent 最大传送内容 1m_第2张图片android intent 最大传送内容 1m_第3张图片android intent 最大传送内容 1m_第4张图片
 
 
 谢谢您的赞助,我会做的更好!

 

 

 

 

 

 

  • android intent 最大传送内容 1m_第5张图片
  • 大小: 141.9 KB
  • 查看图片附件

更多相关文章

  1. Android Studio 新建编辑条 点击按钮显示控件中的内容
  2. android之网络请求 -- 获取RecyclerView的列表项(图片 + 文字)
  3. Android系列之Post图片和数据
  4. Android 自定义camera压缩图片到指定大小
  5. iphone/android比较学习之──图片、文件、字符串
  6. 教你如何修改Android默认字体大小和设置字体大小比例

随机推荐

  1. 10个经典的Android开源项目(线程,网络等学
  2. android 中的监听器与内部匿名类
  3. Android中的Handler用法
  4. Android(安卓)3D游戏开发技术详解与典型
  5. Android网络请求报错:java.net.SocketExce
  6. Android笔试面试题二(常考问答)
  7. Android(安卓)异步消息处理—让你深入理
  8. Android给已生成的安装包apk用自己的keys
  9. android连接远程数据库教程1
  10. 20172314 2017-2018-2《程序设计与数据结