Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Along with Oleg's answer I would add <a href="http://wptrafficanalyzer.in/blog/implementing-horizontal-view-swiping-using-viewpager-and-fragmentpageradapter-in-android/" rel="nofollow">this simple tutorial</a> which I found that has source code you can download and, once that is working for you, you can adapt it to your needs slowly as you learn how it works. This shows how to display a <code>TextView</code> which I believe is what you want instead of an <code>Image</code>. Once you get the basics down from one of the links you have been given, I think you may want to create an <code>ArrayList</code> (possibly in its own class) and get the data from there to add to each page's <code>TextView</code> due to the large number of pages that you plan on having. If you take your time and make sure you understand the basics of how these components work together then I think the rest will come easier for you.</p> <p>I agree with Oleg's answer that you probably want to use a <code>FragmentStatePagerAdapter</code> because of the large amount of pages/data you will have. But give this tutorial a shot and see if that helps you make sense of how these all work together. Good Luck!</p> <p><strong>Update</strong></p> <p>As I haven't done this before I will give my best shot to show you something that might work. Without playing around with it myself, I can't say for sure but I would give this a try (using the code from the turorial and a made up class that returns an array)</p> <pre><code> public Fragment getItem(int arg0) { MyFragment myFragment = new MyFragment(); Bundle data = new Bundle(); String myArrayString = new ArrayClassName().getText(arg0); //This should get a string value from a method you create in your Array class called getText() data.putInt("current_page", arg0); myFragment.setArguments(data); return myFragment; //this hopefully gets passed back to onCreateView() } </code></pre> <p>Then use <code>setText(mCurrentPage)</code> as they did in the <code>onCreateView()</code> to set the page text. I may have missed something since I did all of this in my head but I would imagine something like this would get you started. Hopefully it works because that was a whole lot of work not using this before :D</p>
    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.
 

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