是否有可能创建一个可点击的面包般的通知? [英] Is it possible to create a clickable Toast-like notification?
问题描述
我有一个需要显示一种微创介入式无阻塞通知是的不的依赖于它在显示(活动如吐司
)的和的是点击。任何人有任何知道这是否可能?不幸的是,看起来吐司
的通知(定制或其他方式)是不可点击(即设置了 OnClickListener
上的看法没有任何影响)。而且,纠正我,如果我错了,所有的替代品( AlertDialg
, PopupWindow
, Crouton
)显示绑定在它所示(即他们不会继续显示在活动结束)活动的通知。有什么建议?
I have a need to show a minimally-intrusive non-blocking notification which is not tied to the activity it was shown in (like a Toast
) and which is clickable. Anyone have any idea whether or not this is possible? Unfortunately it appears Toast
notifications (custom or otherwise) are not clickable (i.e. setting an OnClickListener
on its views has no effect). And, correct me if I'm wrong, all the alternatives (AlertDialg
, PopupWindow
, Crouton
) show a notification which is tied to the activity it was shown in (i.e. they won't continue showing when the activity finishes). Any suggestions?
推荐答案
您是对的,一个吐司
对象有没有办法要与互动,但也有许多图书馆在那里,给你相同的外观和感觉敬酒,但有一些互动。我使用的是 https://github.com/JohnPersano/SuperToasts
You are right, a Toast
object has no way to be interacted with, but there are many libraries out there that will give you the same look and feel as a toast, but with some interactivity. The one I use is https://github.com/JohnPersano/SuperToasts
这篇关于是否有可能创建一个可点击的面包般的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!