2012-01-26 86 views
0

我想更改單擊事件上的窗口小部件按鈕的背景,然後返回到原始背景,如ACTION_DOWN和ACTION_UP。 我知道我可以改變背景:Android如何更改按鈕單擊事件的背景?

RemoteViews.setInt(viewId, methodName, value); 

,並添加一個動作click事件:

Intent intent = new Intent(context, MyWidget.class); 
intent.setAction("Restart"); 
PendingIntent pIntent = PendingIntent.getBroasdcast(context, 0, intent, 0); 
RemoteViews.setOnClickPendingIntent(viewId, pIntent); 
+0

不選擇使用遠程視圖? –

回答