Back to project page sqlite.
The source code is released under:
GNU General Public License
If you think the Android project sqlite listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.cs4730.lvcursordemo; //ww w.jav a 2 s. c om import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; public class MainActivity extends FragmentActivity { String TAG = "MainActivity"; SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Create the adapter that will return a fragment for each of the three // primary sections of the activity. mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); //mViewPager.setCurrentItem(7);// set to a specific page in the pager. } /** * A {@link FragmentPagerAdapter} that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentPagerAdapter { public SectionsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch (position) { case 0: return new simple_Fragment(); case 1: return new custom_Fragment(); case 2: return new ExpListview_Fragment(); default: return null; } } @Override public int getCount() { // Show X total pages. return 3; } @Override public CharSequence getPageTitle(int position) { switch (position) { case 0: return "Simple Demo"; case 1: return "Custom Demo"; case 2: return "ExpListView Demo"; } return null; } } }