Question

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 ?

Was it helpful?

Solution

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

Like:

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

By programmatically:

textview.setClickable(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top