I have bitmap displayed on the top of the screen when the app is
started up.
When clicking on the bitmap, the image should move to the bottom of
the screen.

Here is my code

public class HelloAndroid extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       BitmapAnimation tv = new BitmapAnimation(this);
       setContentView(tv);
   }
}

public class BitmapAnimation extends View{
        private Bitmap myBitmap;
        public BitmapAnimation(Context context) {
                super(context);
                BitmapFactory.Options opts = new BitmapFactory.Options();
                opts.inScaled = false;
                myBitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.icon, opts);
        }
        protected void onDraw(Canvas canvas) {
                super.onDraw(canvas);
                canvas.drawBitmap(myBitmap, 0, 0 ,new Paint());
        }
}

-- 
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

Reply via email to