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