Created
September 28, 2020 15:56
-
-
Save plateaukao/a519855748f4360d13e03594c7cf7703 to your computer and use it in GitHub Desktop.
This file contains 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
override fun onWindowFocusChanged(hasFocus: Boolean) { | |
super.onWindowFocusChanged(hasFocus) | |
// what the heck! 這件事做在 onResume() 中是沒有用的。害我試了好久 | |
val clipBoardManager = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager | |
val copiedString = clipBoardManager.primaryClip?.getItemAt(0)?.text?.toString() ?: "" | |
if (copiedString.isNotEmpty()) { | |
handleSendText(copiedString) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment