I'm trying to create a clickable TextView in a notification.
I've created a layout with some TextViews and I use a remoteView to build the notification layout.
In the notification build method I use setOnClickPendingIntent() to assign a Pending Intent to the TextView.
When I actually try to click the TextView the whole notification is 'clicked' (as there is no clickable area besides the whole notification as one block).
I've tried removing the pendingIntent of the notification itself, but yet the whole notification is clicked (just does nothing).
What should be done to make these elements be clickable ?
Are only buttons be clickable in a notification ?

有帮助吗?

解决方案

Mention android:clickable="true" for textviews in layout.

Like:

<TextView android:id="@id/tv1"
android:clickable="true"/>

By programmatically:

textview.setClickable(true);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top