Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top