Hi masters I need some help My fundemantal Project source codes is here http://ift.tt/1R9ohgz A
You can download working zipped project file.
In the FirstFragment class , Button1 works fine with below codes very good
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// View but1 = (View) getActivity().findViewById(R.id.button1);
// //////////
but1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pager.setCurrentItem(pager.getCurrentItem() + 2);
}
});
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
but Button 3 not run with below codes
View but3 = (View) getActivity().findViewById(R.id.button3);
// //////////
but3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
MyPagerAdapter adapterViewPager = ((MyPagerAdapter)pager.getAdapter());
//pager.setCurrentItem(pager.getCurrentItem() + 2);
adapterViewPager.getRegisteredFragment(2;
}
});
//////////////////////////////
In my orginal project I created MANY Fragments class and different layouts, I want to use adapterViewPager.getRegisteredFragment
I want help for adapterViewPager.getRegisteredFragment(..);
Aucun commentaire:
Enregistrer un commentaire