Two buttons with PendingIntents - Widget

萝らか妹 提交于 2019-12-05 11:43:29

Try adding the getActivity PendingIntent.FLAG_UPDATE_CURRENT aswell...

 PendingIntent pendingIntentSettings =  
      PendingIntent.getActivity(context, 0, intentSettings, PendingIntent.FLAG_UPDATE_CURRENT);

and if multiple widget's are possible add the widgetId there too.

Make sure both of the activities/broadcasts are listed in the manifest file.

Moreover, try creating the Intent with this constructor:

 Intent intent = new Intent(context,ACTUALIZAR_WIDGET.class);
 Intent intentSettings = new Intent(context,WidgetConfig.class);

add imports if needed.

Hope some of that will make you widget work.

Tamal Samui

Check this link to know which button has been clicked when there is two or more button in a widget..

https://stackoverflow.com/a/10733049/1331593

It should work... IF it does not work please let me know what is the problem...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!