public class MyPagerAdapter extends PagerAdapter {
public Context context;
public List<Item> list;
public MyPagerAdapter(Context context, List<Item> list){
this.context=context;
this.list=list;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
// TODO Auto-generated method stub
View v = View.inflate(context, R.layout.itempage, null);
ImageView imagepage = (ImageView)v.findViewById(R.id.imagepage);
BitmapUtils bit=new BitmapUtils(context);
bit.display(imagepage,list.get(position%list.size()).img);
container.addView(v);
return v;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
// TODO Auto-generated method stub
container.removeView((View) object);
}
@Override
public int getCount() {
return Integer.MAX_VALUE;
}
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
return arg0==arg1;
}
}
///
public class MainActivity extends FragmentActivity implements OnClickListener{
private ViewPager page;
private LinearLayout line;
private List<ImageView> str;
List<Item> list;
private List<Fragment> listfragment;
private ViewPager page2;
private Button but1;
private Button but2;
private