Hi,
I am trying to rotate an image for every 3 secs, but it's not working. I
did like this
but not working..what may be the reason..?
public class TimerEx extends Activity {
Timer timer;
ImageView image;
Bitmap bMap = null;
Bitmap bitmap;
Matrix mat = new Matrix();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
System.out.println("Inside create");
image = (ImageView) findViewById(R.id.test_image);
bMap = BitmapFactory.decodeResource(getResources(), R.drawable.image);
image.setImageBitmap(bMap);
timer=new Timer();
timer.schedule(new UpdateImage(),100,3000);
}
class UpdateImage extends TimerTask
{
@Override
public void run() {
mat.postRotate(45);
bitmap=Bitmap.createBitmap(bMap,0,0, bMap.getWidth(), bMap.getHeight(),
mat, false);
image.setImageBitmap(bitmap);
}
}
}
--
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