【问题标题】:Android share content click listenerAndroid分享内容点击监听
【发布时间】:2021-07-05 10:54:29
【问题描述】:

有没有办法在安卓分享内容上设置点击监听?

例如,当用户点击 whatsapp 图标时,我们发现了这一点。

注意:据我所知,我们可以使用带有 recycler view 的自定义内容提供程序来处理它,我的问题是关于像 pic 这样的原生 android 内容提供程序。

【问题讨论】:

标签: android share android-contentprovider


【解决方案1】:

给你:

sharebutton.setOnClickListner {
        private fun shareIt() {
        val sendIntent: Intent = Intent().apply {
            action = Intent.ACTION_SEND
            putExtra(Intent.EXTRA_TEXT, "message to send")
            type = "text/plain"
        }
        val shareIntent = Intent.createChooser(sendIntent, null)
        startActivity(shareIntent)
}

来源:Sending simple data to other apps

【讨论】:

    猜你喜欢
    • 2015-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多