TransactionTooLargeException in Nougat

后端 未结 4 1018
故里飘歌
故里飘歌 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:40

    Android 7.0 (Nogat) includes a variety of system and API behaviour changes. Regarding TransactionTooLarge Exception :

    In Android 7.0, many platform APIs have now started checking for large payloads being sent across Binder transactions, and the system now rethrows TransactionTooLargeExceptions as RuntimeExceptions, instead of silently logging or suppressing them. One common example is storing too much data in Activity.onSaveInstanceState(), which causes ActivityThread.StopInfo to throw a RuntimeException when your app targets Android 7.0.

    Possible Solutions : 1. Save required object in global cache and pass only the key to DetailsActivity to retrieve the object.

提交回复
热议问题