To implement multiple ListView for a Viewpager take a look at this example: MainActivity.java public class MainActivity extends Activity { /** Called when the activity is first created. */ private Context mContext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mContext = this; setContentView(R.layout.main); ListView listview1 = new ListView(mContext); ListView listview2 = new ListView(mContext); ListView listview3
Tag: viewpager
Android ViewPager Compatibility Package
Android got a compatibility package you need to add to use the ViewPager. android.support.v4.view.ViewPager Make sure it’s the v4 or newer. Take a look at the Support Library Further look: Adding a library/JAR to an Eclipse Android project
Android Get Focused View From ViewPager
To get the focused view in a Android ViewPager call the OnPageSelected(). private int focused = 0; private class MyPageChangeListener extends ViewPager.SimpleOnPageChangeListener { @Override public void onPageSelected(int position) { focused = position; } } Take a look at this interesting blogpost about ViewPager