Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print this Map<String,Object> params = new LinkedHashMap<>(); on Android Studio

I'm developing an app and I need to print this type of data

Map<String,Object> params = new LinkedHashMap<>();

How could I print it in the logcat console?

like image 514
Trusted Avatar asked Oct 21 '25 19:10

Trusted


1 Answers

Import the Android log utility

import android.util.Log;

Then it's as simple as

Log.d("AnyTagYouWant", params.toString());

LinkedHashMap (like all AbstractMap subclasses) displays all its keys and values in its toString method.

like image 88
Leo Aso Avatar answered Oct 23 '25 11:10

Leo Aso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!