I have two fragments ListNav and SwipeNav in Navigation Drawer. ListNav shows list view of data from String array. SwipeNav shows data as swipe views of the same data from string array. I am able to replace fragment from ListNav to SwipeNav. String array data shows 'A to Z'.
My problem is when I click on list in ListNav (Suppose B)then SwipeNav(replaced Fragment) shows swipe views from start(means A). Suppose, if I click on 'D' in ListNav through Fragment replace, SwipeNav will show 'D'. Plz suggest me how I will implement this.
String Array:
<string-array name="tab_titles">
<item>A</item>
<item>B</item>
<item>C</item>
<item>D</item>
<item>E</item>
<item>F</item>
<item>G</item>
<item>H</item>
<item>I</item>
........
</string-array>
I ListNav I use below to replace to SwipeNav with OnItemClickListener:
FragmentManager fm=getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.replace(((ViewGroup)(getView().getParent())).getId(), new SwipeNav());
ft.addToBackStack(null);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
SwipeNav shows Data as Swipe Views through PagerAdapter from String Array:
tabTitlesArray = context.getResources().getStringArray(R.array.tab_titles);