Domanda

How I can convert this to Fragment to use ViewPager?

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    final ViewHolder holder;
    View view = convertView;

    if (view == null) {

       view = getLayoutInflater().inflate(R.layout.item_grid_image, parent,    false);
       holder = new ViewHolder();
       assert view != null;
       holder.imageView = (ImageView) view.findViewById(R.id.image);
       holder.progressBar = (ProgressBar)view.findViewById(R.id.progress);
       view.setTag(holder);
           // ......
    }

}

Nessuna soluzione corretta

Altri suggerimenti

Here are examples for implementing ViewPager ViewPager Tutotial & ViewPager with FragmentPageAdapter

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top