Created
October 10, 2022 15:46
-
-
Save rommansabbir/273ee3055a89b35d749b03f739fb4696 to your computer and use it in GitHub Desktop.
Intent Debug Ext
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
fun Intent?.toDebugString(): String { | |
val intent = this ?: return "" | |
return StringBuilder().apply { | |
appendLine("--- Intent ---") | |
appendLine("type: ${intent.type}") | |
appendLine("package: ${intent.`package`}") | |
appendLine("scheme: ${intent.scheme}") | |
appendLine("component: ${intent.component}") | |
appendLine("flags: ${intent.flags}") | |
appendLine("categories: ${intent.categories}") | |
appendLine("selector: ${intent.selector}") | |
appendLine("action: ${intent.action}") | |
appendLine("dataString: ${intent.dataString}") | |
intent.extras?.keySet()?.forEach { key -> | |
appendLine("* extra: $key=${intent.extras!![key]}") | |
} | |
}.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment