我想在按钮点击上更改viewPager适配器,如
pager = (ViewPager) findViewById(R.id.pager);
button1.setOnClickListener(){
adapter1 = new ViewPagerAdapter(getSupportFragmentManager(), Titles, Numboftabs); // adapter 1
pager.setAdapter(adapter1);
}
button2.setOnClickListener(){
adapter2 = new ViewPagerAdapter(getSupportFragmentManager(), Titles, Numboftabs); // adapter 2
pager.setAdapter(adapter2);
}
可以做..?