public MyGalleryAdapter(Context context) { this.context = context; TypedArray array = context.obtainStyledAttributes(R.styleable.gallery); itemBacklground = array.getResourceId(R.styleable.gallery_android_galleryItemBackground, 0); array.recycle(); }