I use ViewPager to switch several views.
public class MainA extends ActivityGroup {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ViewPager pager = (ViewPager)findViewById(R.id.viewpager);
ViewPager pager = (ViewPager)findViewById(R.id.viewpager);
View view1 = inflater.inflate(R.layout.viewa,null );
View view2 = inflater.inflate(R.layout.viewp, null);
ImageView imageView = new ImageView(getApplicationContext());
imageView.setImageResource(R.drawable.ic_action_search);
views.add(imageView);
views.add(view1);
views.add(view2);}}
ViewPager will set imageView as first view. When I turn left,there is no view. When I turn right , view1 will come out. Now I have one question. I want to set view1 as first view. When I turn left, imageView will come out. When I turn right, view2 will come out. How to do that ???