TransactionTooLargeException in Nougat

后端 未结 4 993
故里飘歌
故里飘歌 2021-01-06 00:57

Exception

 05-12 15:42:45.791 11043-11043/ E/UncaughtException: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 631792         


        
4条回答
  •  孤城傲影
    2021-01-06 01:30

    Regarding the Doc This Exception throw when value are too large to fit in the transaction buffer. And might be a complicated issue, for a big project, where you can invokes several actions with sending Intent in difference places.

    Your example demonstrate this issue, even with single object. And you should change your transferring behavior at all. For ex. by trimming object, to contain only important info. Intent Extra Data should have only lightweight info!


    In you example you have field, which might produce this issue. Probably you are using Base64 Encoded image. Exception with message text, specific only for Android 23. Check the doc.

    public String getImage() {
        return image;
    }
    
    public void setImage(String image) {
        this.image = image;
    }
    

提交回复
热议问题