I have a simple widget (whose entire layout is just an ImageView) that
starts and stops a service. From within the service, I'd like to
switch the image displayed by such ImageView.
So, i did this:
public int onStartCommand(Intent intent, int flags, int startId){
RemoteViews remoteViews = new RemoteViews(getPackageName(),
R.layout.main);
remoteViews.setImageViewResource(R.id.imgView, R.drawable.image1);
...
...
return START_STICKY;
}
and
public void onDestroy(){
RemoteViews remoteViews = new RemoteViews(getPackageName(),
R.layout.main);
remoteViews.setImageViewResource(R.id.imgView, R.drawable.off);
...
...
}
But it doesn't work. onStartCommand and onDestroy are called, but the
image doesn't change.
What gives?
Simone
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en