Skip to main content

Posts

Showing posts with the label horizontal wipe

Swipe To Change Page in ANDROID or Page Swiping Using ViewPager FragmentActivity in ANDROID

See more basics on Android along with interview questions Here we are going to deal with horizontal view swiping with ViewPager.The ViewPager control (android.support.v4.view.ViewPager) provides the horizontal swiping behavior. It can be used within your layouts much like a Gallery or other adapter-populated user interface control would be. The PagerAdapter (android.support.v4.view.PagerAdapter) class is used to define the data displayed by the ViewPager control. Here we are going to load a string from json(kept in text file in asset folder) in the swiping view. Here we go with java source code public class Viewpagers extends FragmentActivity { // android.support.v4.app.FragmentStatePagerAdapter. SectionsPagerAdapter mSectionsPagerAdapter; // The ViewPager that will host the section contents. ViewPager mViewPager; String text; JSONArray jArray; ArrayList<String> Questionarray = new ArrayList<String>(); ArrayList<String> Answerarray = new Array...