1. 程式人生 > >android.os.TransactionTooLargeException

android.os.TransactionTooLargeException

產生原因及解決辦法在stackoverflow上已經有人提過了,說的也很詳細。
大致意思是,activity之前,或activty和service之前,以及通過ipc通訊等,傳輸的內容,比如intent,如果資料量過大就會導致出現這個異常。常見的錯誤使用:1,傳輸大檔案,比如bitmap等。

剛才我的程式在紅米note3上出現了這個問題:選擇圖片->呼叫系統擷取圖片。擷取後直接crush了。但,如果擷取的是非常非常小的圖片,就沒有問題,能夠成功傳回來。 對於這款機型有點無語。。。

為了解決這個問題,我們參照微信是怎麼做的。開啟微信的頭像選擇,發現它是跳回到自己定義的介面進行圖片擷取操作,好吧。。。解決方法很暴力,不使用系統的圖片裁剪,自己裁剪。(因為選擇圖片傳回來的是uri,裁剪是直接把圖片資料傳回來了。)

下版本更新功能,自定義圖片裁剪。

相關推薦

android.os.TransactionTooLargeException: data parcel size 962920 bytes

完整異常資訊是這樣的: Exception thrown launching activities in ProcessRecord{202c714 11807:com.lib.jiabao_w/u0a240} android.os.TransactionTooLargeExc

Android 資料傳遞出現的android.os.TransactionTooLargeException問題

開發中在頁面跳轉中經常需要徐攜帶資料到另一個頁面,常用的是intent傳遞,然而在intent的Bundle等傳遞資料時有一個緩衝區,而這個緩衝區最大隻有1MB,當資料大於這個值時就會出現android.os.TransactionTooLargeException問題,這時就不能用intent來傳

Android呼叫系統裁減圖片,出現android.os.TransactionTooLargeException: data parcel size 642356 bytes

1、Android拍照和相簿+系統裁剪功能返回圖片http://blog.csdn.net/why110999784/article/details/52460403 2、裁減圖片時傳遞的return-data設定為true,在onActivityResult的Inten

android.os.TransactionTooLargeException

產生原因及解決辦法在stackoverflow上已經有人提過了,說的也很詳細。 大致意思是,activity之前,或activty和service之前,以及通過ipc通訊等,傳輸的內容,比如intent,如果資料量過大就會導致出現這個異常。常見的錯誤使用:1,

Android異常:android.os.TransactionTooLargeException

最近在做專案的時候遇到個異常,經過反覆除錯,終於得知原因了 首先來看看出現異常的原因: 因為伺服器開發限制,返回給我的圖片資源都是使用base64編碼後的String字串,而產品要求將所有的圖片能夠支援Android圖片庫的瀏覽方式,於是想都沒想,直接將返回的List<

ViewPager+Fragment出現android.os.TransactionTooLargeException的坑!!!

今天用viewpager+fragment實現一個需求,裡面的fragment有30多個吧。資料量很大,不過介面可以正常顯示,也沒報錯,但是當我跳轉到下一個介面的時候,立馬出現 android.os.TransactionTooLargeException

android.os.TransactionTooLargeException異常

http://blog.csdn.net/ballonge/article/details/51085778 一. 背景 輸入法在V2.30(185)和V2.35(196)兩個版本中都碰到了大量的TransactionTooLargeException的崩潰問題,其

android.os.TransactionTooLargeException: data parcel size xxxx bytes

針對這個問題也百度看了一下, 發現其實很多人都遇到過這個問題 1. 介面跳轉   intent 中的資料內容較多   android.os.TransactionTooLargeException     2. Android呼叫系統裁減圖片,出現android.os.Tr

android.os.NetworkOnMainThreadException

col 多圖片 pconnect req word oat activit pan 鏈接 在搞android開發中過程中。是關於HttpURLConnection鏈接的,我是上傳多個同一個名稱的數據到server,本來在2.3版本號上能夠執行。可是在4.2版本號上就

【邊做項目邊學Android】異常處理:android.os.NetworkOnMainThreadException--多線程問題

不能 timeout throws extend dex com order trace res 一切搞定。以為高枕無憂了,結果還是有問題! log開始報錯了,獲取更新信息異常。。!debug一下。發現Exception:android.os.NetworkOnM

Android Unable to add window -- token android.os.BinderProxy@3a067204 is not valid錯誤分析記錄

原因 val 原因分析 創建 轉換 active star 生命周期 stop 打開APP時,出現閃退的情況,查看android studio報錯信息,主要為: Unable to add window -- token android.os.BinderProxy@3a

Android OS 特性總結

主題 新功能 平臺 客戶 單獨 改善 ogl 網站 理念 - 信息來自百度百科,僅做歸納總結 - Android 8 (Oreo) 發布於2017年8月22日 奧利奧版安卓的聚焦重點是電池續航能力、速度和安全,讓用戶更好地控制各種應用程序。通過對安卓6(棉花糖)、安卓7(牛

android.os.FileUriExposedException: file:///storage/emulated/0/myxmpp/154094

在專案的MainActivity的開始新增下面這段程式碼 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {     StrictMode.VmPolicy.Builder builder = new Strict

Unknown failure (at android.os.Binder.execTransact(Binder.java:565))Error while Installing APKs

今天手機調試出現這個問題: Unknown failure (at android.os.Binder.execTransact(Binder.java:565))Error while Installing APKs   在執行的時候出現提示大致意思:解除安裝刪除已存在

解決用Android N編譯版本引起的android.os.FileUriExposedException

          app一般都有檢測新版本自動升級的功能, 一但使用Android NSDK版本來編譯, app啟動安裝新apk的時候會出來FileUriExposedException, 我們需要做的是:  

android.os.SystemProperties

想根據型號來做判斷,然後找到了使用SystemProperties這個類可以判斷機具型號, String model= SystemProperties.get("ro.product.model"); if(model.equals("xx")) {//判斷是否是XX型號 return

Android 7.0 呼叫相機 android.os.FileUriExposedException

import android.R.integer; import android.app.Activity; import android.app.Dialog; import android.content.ContentValues; import android.c

安卓異常:android.os.FileUriExposedException:

    android.os.FileUriExposedException: file:///storage/emulated/0/picture1537259111.jpg exposed beyond app throughClipData.Item.getUri()

Unknown failure (at android.os.Binder.execTransact(Binder.java:674))解決辦法

Android Studio 匯入新工程時出現,提示: Unknown failure (at android.os.Binder.execTransact(Binder.java:674)) Error while Installing APKs 解決辦法: 出現這個

安裝新版本的apk:android.os.FileUriExposedException

最近在做app更新升級功能的時候,又碰到因為android 7.0 引起的相容問題了。 android.os.FileUriExposedException: file:///storage/emula