How to print this Map params = new LinkedHashMap<>(); on Android Studio Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to print this Map params = new LinkedHashMap<>(); on Android Studio without wasting too much if your time.

The question is published on by Tutorial Guruji team.

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?

Answer

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.

We are here to answer your question about How to print this Map params = new LinkedHashMap<>(); on Android Studio - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji