2016-03-30 26 views

cevap

1

Değişim onBindViewHolder yöntemde RecyclerView.ViewHolderRec için RecyclerView.ViewHolder ilk parametresi.

+0

Teşekkür ederiz @Zahidul Islam –

0

ViewHolder çözemezse olsun:

public static class ViewHolder extends RecyclerView.ViewHolder { 
    // each data item is just a string in this case 
    public TextView mTextView; 
    public ViewHolder(TextView v) { 
     super(v); 
     mTextView = v; 
    } 
} 

RecyclerView.Adapter:

@Override 
public void onBindViewHolder(ViewHolder holder, int position) { 
    // - get element from your dataset at this position 
    // - replace the contents of the view with that element 
    holder.mTextView.setText(mDataset[position]); 

} 
+0

Bu kod çalışmıyor –

+1

Resmi Android Eğitiminin örnek kodundan beri bu beni şaşırtıyor: http://developer.android.com/training/material/lists-cards.html – Exaqt