Skip to content

Instantly share code, notes, and snippets.

@kaiinui
Created April 6, 2015 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaiinui/708cb8c34316f5c34298 to your computer and use it in GitHub Desktop.
Save kaiinui/708cb8c34316f5c34298 to your computer and use it in GitHub Desktop.
BundleUtils.java
public class BundleUtils {
public static String toString(Bundle bundle) {
final StringBuilder sb = new StringBuilder("Bundle: \n");
final Set<String> keys = bundle.keySet();
final Iterator<String> it = keys.iterator();
while (it.hasNext()) {
final String key = it.next();
final Object obj = bundle.get(key);
// #{KEY} : #{VALUE} (#{TYPE})
sb.append(key).append(" : ").append(obj).append(" (" + obj.getClass().getSimpleName() + ")").append("\n");
}
return sb.toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment