Code example for Gallery

Methods: getSelectedItemPosition

0
            return image;
        } 
    } 
 
    public void onClick(View v) {
        selectWallpaper(mGallery.getSelectedItemPosition());
    } 
 
    class WallpaperLoader extends AsyncTask<Integer, Void, Bitmap> {
        BitmapFactory.Options mOptions;
 
        WallpaperLoader() { 
            mOptions = new BitmapFactory.Options();
            mOptions.inDither = false;
            mOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;            
        } 
         
        protected Bitmap doInBackground(Integer... params) {
            if (isCancelled()) return null;
            try { 
                return BitmapFactory.decodeResource(getResources(),