Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, perform action when widget is clicked

Can someone provide me with an example of how to perform an action when the user taps on a widget? The only example I have found launches an activity. I assume that it must still do it with some sort of pending intent and maybe a broadcast receiver, but I'm not sure how to do it.

like image 277
Kratz Avatar asked Jun 11 '26 13:06

Kratz


1 Answers

Call RemoteViews.setOnClickPendingIntent on the views in your widget (assuming you have views in your widget).

like image 164
EboMike Avatar answered Jun 13 '26 12:06

EboMike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!