I have a Android App widget and a button on the widget. I have set the update time period to 30mins but I also want to update the widget whenever I touch the button. here's my code:
RemoteViews remoteV = new RemoteViews(context.getPackageName(), R.layout.widgetmenu);
Intent intentSync = new Intent(context, MessMenuWidgetProvider.class);
PendingIntent pendingSync = PendingIntent.getBroadcast(context,0, intentSync,0);
remoteV.setOnClickPendingIntent(R.id.imageButtonSync,pendingSync);
appWidgetManager.updateAppWidget(awID, remoteV);
I have set the update time to 30 mins so in every 30mins the function onUpdate() is called. What I want to achieve is to call onUpdate() manually using the button. But it's not happening. Any help?