Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a class extending Fragemnt </p> <pre><code>class ExampleFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { View v = inflater.inflate(R.layout.dates_carusel_item, null); return v; } </code></pre> <p>And in your PagerAdapter do this</p> <pre><code> private class DatesPagerAdapter extends FragmentPagerAdapter { public DatesPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int arg0) { ExampleFragment fragment=new ExampleFragment(); Bundle bundle=new Bunlde(); //put bundle data here fragment.setArguments(bundle); return fragment; } @Override public int getCount() { 5; } } </code></pre> <p>Whatever view you want to set do it on the Example Fragment and add your viewPager</p> <pre><code>ViewPager pager=new ViewPager(this); pager.setAdapter(new DatesPagerAdapter); llContainer.addView(pager) </code></pre> <p>Add your ViewPager in xml itself to get it proprly alligned or else you can setLayoutParams in runtime if its a visibilty error</p> <pre><code> android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_below="@id/view_contact_sub_nav"android:id="+id/view_contact_values_container" android:paddingLeft="10dip"&gt; &lt;android.support.v4.view.ViewPager android:id="@+id/imagesgallery" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload