Code example for ViewPager

Methods: setAdapter, setId

        return f;
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {        
        ViewPager pager = new ViewPager(getActivity());
        pager.setId(0xFace); // Book. 
        ArrayList<Conference> conferences = getArguments().getParcelableArrayList("conferences");
        pager.setAdapter(new ConferencesAdapter(getChildFragmentManager(), conferences));
        return pager;
    public static class ConferenceFragment extends SherlockFragment { 
        private ImageView mImage;       
        private TextView mName;
        private TextView mSpeaker;
        private TextView mLocation;
Connect your IDE to all the code out there  Get Codota for Java