View v = inflater.inflate(R.layout.gallery_rtl, container, false); Gallery g = (Gallery) v.findViewById(R.id.galleryview); g.setAdapter(new BiDiTestGalleryImages(this.getActivity().getBaseContext())); return v;