What to do on TransactionTooLargeException

前端 未结 30 3411
盖世英雄少女心
盖世英雄少女心 2020-11-22 03:08

I got a TransactionTooLargeException. Not reproducible. In the docs it says

The Binder transaction failed because it was too large.

D

30条回答
  •  自闭症患者
    2020-11-22 03:44

    I faced with the same issue when I tried to send bitmap via Intent and at the same time when it happens I folded the application.

    How it described in this article enter link description here it happens when an Activity is in the process of stopping, that means that the Activity was trying to send its saved state Bundles to the system OS for safe keeping for restoration later (after a config change or process death) but that one or more of the Bundles it sent were too large.

    I solved it via hack by overriding onSaveInstanceState in my Activity:

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        // super.onSaveInstanceState(outState);
    }
    

    and comment call super. It is a dirty hack but it is working perfectly. Bitmap was successfully sent without crashes. Hope this will help someone.

提交回复
热议问题