The tutorial says to use android.appwidget.action.APPWIDGET_UPDATE in the action element within the XML intent-filter.
However,
this is the value of a String constant ACTION_APPWIDGET_UPDATE in
android.appwidget.AppWidgetManager
— I am new to Android but in general programming it is encouraged to use symbolic constants rather than literal values.
Can I use android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE in my xml file rather than “android.appwidget.action.APPWIDGET_UPDATE”?
This is somewhat of a good practices question rather than a get-me-unstuck one.
The answer is no, Android does not allow it, and I cannot think of a compelling reason why. The question asks specifically about a standard Android string literal, rather than a custom string literal, hence I am not accepting the other answer (which is still a good answer so upvoting).