Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Last active September 1, 2015 16:16
Show Gist options
  • Save mortenjust/4618b39fdc977fc84235 to your computer and use it in GitHub Desktop.
Save mortenjust/4618b39fdc977fc84235 to your computer and use it in GitHub Desktop.
Dump android intent
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