Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'll have to test the code, but from what I see, easiest way to make this work is to grab new Fragment even if it is the same fragment class.</p> <blockquote> <p>Fragment how = XmlParserSax.howFragments.get(i);</p> </blockquote> <p>If this function is returning new instance of a fragment, it should work.</p> <p>Hope that helps</p> <p>Edit : </p> <p>I'm pretty sure the activity can access the button after the fragments are created. Otherwise you need a handler to pass the click to handle it in the adapter. I'm seeing the your list of fragments are static (Not recommended). Since you haven't added any codes for how you setup the pageradapter, I have no idea what list you are using, but you need to change out the item in that list. From the Activity where you initialized the pager, you can call the public function to replace the current pager item pager. (you can use ViewPager.getCurrentItem())</p> <p>I haven't tested, so you might have to tweak and play around to perfect it.</p> <p>Hope this helps.</p> <p>Here is a sample : </p> <blockquote> <pre><code> public static class MyAdapter extends FragmentStatePagerAdapter { ArrayList&lt;Fragment&gt; fragmentArray = new ArrayList&lt;Fragment(); public MyAdapter(FragmentManager fm) { super(fm); } //didn't put in the function to populate the list with fragments public void replaceItem(Fragment newFrag, int pos){ fragmentArray.remove(pos); fragmentArray.add(pos,newFrag); notifyDataSetChanged(); } @Override public int getCount() { return fragmentArray.size(); } @Override public Fragment getItem(int position) { return fragmentArray.get(position); } </code></pre> <p>}</p> </blockquote>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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