Skip to main content

Posts

Showing posts with the label viewpager

Viewpager with multiple views inside like "Pulse” app strip

I'm using ViewPager according to this wonderful tutorial: http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/ This tutorial show how to display only one "page" or view in every time/swip. How can I make something like the strip in Pulse app: That have the snapping effect like ViewPager but can have multiple views inside?

Viewpager doesn't update/loads xml items

I solved the question with onclicklistsner issue with viewpager but now I noticed, that it depends on all Elements in XML Layout files. I implemented a ViewPager with that Tutorial: tutsplus Now I have the Problem, that all the Objects I defined in XML are instantiated correct (not null in Debuggin mode after findViewById etc) but I can't reffer to them. To understand it better here my PagerAdapter: class MyPagerAdapter extends PagerAdapter { public int getCount() { return 3; } public Object instantiateItem(View collection, int position) { LayoutInflater inflater = (LayoutInflater) collection.getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); int resId = 0; switch (position) { case 0: resId = R.layout.settings_view; break; case 1: resId = R.layout.push_view; break; case 2: resId = R.layout.listen_view; break;