Blog Archives

Android ViewPager With ListView Pages

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

Posted in Android, Tips and Tricks Tagged with: , ,

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

Posted in Android, Tips and Tricks Tagged with: , ,

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;

Posted in Android, Tips and Tricks Tagged with: , ,