通知点击事件时的通话活动 [英] Call activity when on notification tap event
本文介绍了通知点击事件时的通话活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在用户下拉通知并点击该通知时调用该活动.我该怎么办?
I want to call the activity when user pull down the notification and tap on that notification. How can I do that?
推荐答案
在 Notification
对象上调用 setLatestEventInfo()
,并提供 PendingIntent
当他们在通知抽屉中点击您的条目时,将开始您的活动.这是一个示例项目进行演示.
Call setLatestEventInfo()
on the Notification
object, supplying a PendingIntent
that will start your activity when they tap on your entry in the notification drawer. Here is a sample project demonstrating this.
这篇关于通知点击事件时的通话活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文