I copy a large text to clip board programatically.
ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("Log", log.toString());
clipboardManager.setPrimaryClip(clipData);
If the text is too large, I get the following exception:
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1048812 bytes
at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:144)
How do I know the limit and copy as much text as possible?