Now I use for all child views at listview item only broadcast receiver events. If for some views I need open activity, then use application context and flag FLAG_ACTIVITY_NEW_TASK
Different actions on listview click at appwidget
-
30-06-2022 - |
Question
I have appwidget with listview. Each listview item have different child views. I want, that on click some views I get event in my widget provider, and another views click: open activity. I can set events only on open activity or on get event in broadcast receiver, but not both. How I can todo this?
At first I set setPendingIntentTemplate for listview at widget view. Next on bind item at listview in RemoteViewsFactory
I set setOnClickFillInIntent.
But in setPendingIntentTemplate
I can set PendingIntent, generated from getBroadcast or getActivity.
Ofcouse, I can use for all child item views use PendingIntent
from broadcast.But then how I can open activity on receive event?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow