Displaying More string on Logcat

前端 未结 6 937
长发绾君心
长发绾君心 2020-12-04 18:10

I am currently working on an android App that uses \'JSON\' as response from server. Usually I work on the JSON response. But now I have a problem with logcat, if the JSON

6条回答
  •  长情又很酷
    2020-12-04 18:43

    Ugly but it does the job:

    public static void longInfo(String str) {
        if(str.length() > 4000) {
            Log.i(TAG, str.substring(0, 4000));
            longInfo(str.substring(4000));
        } else
            Log.i(TAG, str);
    }
    

提交回复
热议问题