Code example for ImageButton

Methods: setImageDrawablesetScaleType

0
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
        .detectAll()   // or .detectAll() for all detectable problems
        .penaltyLog()
        .build());    
        super.onCreate(savedInstanceState);
        ImageButton v = new ImageButton(this);
        v.setScaleType(ScaleType.FIT_XY);
		GifDrawable drw=new GifDrawable("/sdcard/gifs/large.gif");
       v.setImageDrawable(drw);
//        Gallery v=new Gallery(this); 
//        v.setAdapter(new ImageAdapter(new File("/sdcard/gifs").listFiles())); 
        setContentView(v);
    } 
    public class ImageAdapter extends BaseAdapter {
    	final File[] items;
    	 
        public ImageAdapter(File[] items) {
			this.items = items;
		} 
 
		public int getCount() {