Skip to content

Instantly share code, notes, and snippets.

@ericharlow
Last active June 15, 2018 15:29
Show Gist options
  • Save ericharlow/2acb3c31be3a238b870e563e6d405a1b to your computer and use it in GitHub Desktop.
Save ericharlow/2acb3c31be3a238b870e563e6d405a1b to your computer and use it in GitHub Desktop.
Makes a printable string of the contents of a Bundle
fun Bundle.toContentString(): String {
val builder = StringBuilder("Extras:\n")
for (key in keySet()) {
val value = get(key)
builder.append(key).append(": ").append(value).append("\n")
}
return builder.toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment