Sorry, My english is not good. I have a view with procedure onDraw: I want to load the two image from the R.drawable.crab file to simulate the GIF Animator. But it only display the image once. Here is my code. (Remark: the first and second image are cut from R.drawable.crab) @Override protected void onDraw(Canvas canvas){ Resources res = getResources(); Bitmap icon = BitmapFactory.decodeResource(res, R.drawable.crab ); //first image cut from crab image file Bitmap bm1 = Bitmap.createBitmap(icon, 0, 100, 100, 100);
//second image cut from crab image file Bitmap bm2 = Bitmap.createBitmap(icon, 0, 200, 100, 100); //display first image canvas.drawBitmap(bm1, 100, 100, null); //wait try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //display second image canvas.drawBitmap(bm2, 100, 100, null); }
-- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en