mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-06 02:35:41 +08:00
Merge code
This commit is contained in:
@@ -269,7 +269,7 @@ fun Context.openBrowser(url: String, packageName: String = "") = runCatching {
|
|||||||
* 复制到剪贴板
|
* 复制到剪贴板
|
||||||
* @param content 要复制的文本
|
* @param content 要复制的文本
|
||||||
*/
|
*/
|
||||||
fun Context.copyToClipboard(content: String) = runCatching {
|
fun Context.copyToClipboard(content: String) = runSafe {
|
||||||
(getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager).apply {
|
(getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager).apply {
|
||||||
setPrimaryClip(ClipData.newPlainText(null, content))
|
setPrimaryClip(ClipData.newPlainText(null, content))
|
||||||
(primaryClip?.getItemAt(0)?.text ?: "").also {
|
(primaryClip?.getItemAt(0)?.text ?: "").also {
|
||||||
|
Reference in New Issue
Block a user