![]() | |
| post pic |
I would post a lot of good quality post for online learner and unique code we have to learn from this blog site. I always thinking the best of mine and hope everyone got helps from this atrocious blog.
Android View Pager Just make it easy
There is a lot of code around the online for making view pager
Actually this tutorial is much easy to creating viewpager
First Open the android studio and create a Project as your app name,
Then we have to create Tab layout for view pager Tab and also make a Pager Adapter .
We Need Three fragment Layout for view pager and define the adapter.
Tep by step process in down here.......
1st step: Open android studio and create project
ViewPger Adapter code is here........
public class MyPagerAdapter extends FragmentStatePagerAdapter {
int mNumberOfTabs; public MyPagerAdapter(FragmentManager fm, int NumberOfTabs) { super(fm); this.mNumberOfTabs = NumberOfTabs; } @Override public int getCount() { return mNumberOfTabs; } @Override public Fragment getItem(int position) { switch (position){ case 0: FragmentHealth fragmentHealth = new FragmentHealth(); return fragmentHealth; case 1: FragmentYoga fragmentYoga = new FragmentYoga(); return fragmentYoga; case 2: FragmentHospital fragmentHospital = new FragmentHospital(); return fragmentHospital; default: return null; }
}
2nd Step is:
This Is Tst Post....
<?xml version="1.0" encoding="utf-8"?><LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center">
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout>
Full Source Code See It here


Hi, This is test Comment
ReplyDelete