Home > Blockchain >  The entire object data is not displayed in logcat android
The entire object data is not displayed in logcat android

Time:07-25

In the Android Studio program, when printing the object, it is cut off due to the length of the data. How can I print the matrix without any cuting?

enter image description here

CodePudding user response:

To print a lengthy string in logcat, use this piece of code. Here s is the string which is to be printed. I tried this code where s is given as a sample text of 1000 words and was successfully displayed Logcat.

In java,

final int maxSize = 2048;
for (int i = 0; i < s.length(); i  = maxSize) {
    Log.d("largeString", s.substring(i, Math.min(s.length(), i   maxSize)));
}

Try this code and hope this works for you.

  • Related