I would like to change the background of a widget button on a click event and then return to the original background, something like ACTION_DOWN and ACTION_UP.
I know that i can change the background with:
RemoteViews.setInt(viewId, methodName, value);
and add an action to a click event:
Intent intent = new Intent(context, MyWidget.class);
intent.setAction("Restart");
PendingIntent pIntent = PendingIntent.getBroasdcast(context, 0, intent, 0);
RemoteViews.setOnClickPendingIntent(viewId, pIntent);
Have a look at StateList xml files. The selectors that these files use will handle changing your View’s background in all of its various states, and you don’t have to mess with writing your own touchlistener.
http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList