• android FragmentPagerAdapter的“标准”配置


    private class ImagePagerAdapter extends FragmentPagerAdapter {
     
            public List<ImageItem> fileList;
     
            public ImagePagerAdapter(FragmentManager fm, List<ImageItem> fileList) {
                super(fm);
                this.fileList = fileList;
            }
     
            @Override
            public int getCount() {
                return fileList == null 0 : fileList.size();
            }
            @Override
            public int getItemPosition(Object object) {
                return POSITION_NONE;
            }
            @Override
            public boolean isViewFromObject(View view, Object obj) {
                return view == ((Fragment) obj).getView();
            }
            @Override
            public void destroyItem(ViewGroup container, int position, Object object) {
                Fragment fragment = ((Fragment) object);
                container.removeView(fragment.getView());
                FragmentUtils.removeFragmentRecently(getSupportFragmentManager(), fragment);
            }
            @Override
            public Fragment getItem(int position) {
                String url = fileList.get(position).getActualUrl();
                return ImageDetailFragment.newInstance(url);
            }
     
        }
  • 相关阅读:
    servlet里的forward和redirect的区别
    JSP九大内置对象
    float和Float的区别
    Throwable相关知识1
    常见异常和错误总结
    final/finalize/finally的区别
    mysql命令大全
    mongodb安装
    mysql编译安装(详细)
    mysql的三种安装方式(详细)
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/4503820.html
Copyright © 2020-2023  润新知