Last active
September 1, 2015 16:16
-
-
Save mortenjust/4618b39fdc977fc84235 to your computer and use it in GitHub Desktop.
Dump android intent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogUtil { | |
private static final String TAG = "IntentDump"; | |
public static void dumpIntent(Intent i){ | |
Bundle bundle = i.getExtras(); | |
if (bundle != null) { | |
Set<String> keys = bundle.keySet(); | |
StringBuilder stringBuilder = new StringBuilder(); | |
stringBuilder.append("IntentDump \n\r"); | |
stringBuilder.append("-------------------------------------------------------------\n\r"); | |
for (String key : keys) { | |
stringBuilder.append(key).append("=").append(bundle.get(key)).append("\n\r"); | |
} | |
stringBuilder.append("-------------------------------------------------------------\n\r"); | |
Log.i(TAG, stringBuilder.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment