I have a Android APP and widget. I am trying to update the widget everytime a user enters in a score.
The code I have in the Widget file is
The System.out is printing out the correct value, but I cannot get the widget to update. Any ideas?
The code I have in the Widget file is
Code:
public void onReceive(Context ctxt, Intent intent) {
if (intent.getAction() == null) {
int value = intent.getIntExtra("Value", 0);
RemoteViews remoteViews = new RemoteViews(ctxt.getPackageName(), R.layout.widget);
remoteViews.setTextViewText(R.id.widgetAmount, String.valueOf(value));
number = value;
System.out.println(number);
} else {
super.onReceive(ctxt, intent);
}
}
The System.out is printing out the correct value, but I cannot get the widget to update. Any ideas?