小编gol*_*har的帖子

如何在recyclerview项目中获取文本视图的值?

这是我的适配器RecyclerView.我怎样才能获得deckName另一项活动的价值?

public class ViewHolder extends RecyclerView.ViewHolder {
    public RelativeLayout deckLayout;
    public LinearLayout countsLayout;
    public ImageButton deckExpander;
    public ImageButton indentView;
    public  TextView deckName;
    public TextView deckNew, deckLearn, deckRev;

    public ViewHolder(View v) {
        super(v);
        deckLayout = (RelativeLayout) v.findViewById(R.id.DeckPickerHoriz);
        countsLayout = (LinearLayout) v.findViewById(R.id.counts_layout);
        deckExpander = (ImageButton) v.findViewById(R.id.deckpicker_expander);
        indentView = (ImageButton) v.findViewById(R.id.deckpicker_indent);
        deckName = (TextView) v.findViewById(R.id.deckpicker_name);
        deckNew = (TextView) v.findViewById(R.id.deckpicker_new);
        deckLearn = (TextView) v.findViewById(R.id.deckpicker_lrn);
        deckRev = (TextView) v.findViewById(R.id.deckpicker_rev);


    }
}
Run Code Online (Sandbox Code Playgroud)

我想获取此值并将其与字符串进行比较:

final int itemCount = mDeckListAdapter.getItemCount();
DeckAdapter a = new …
Run Code Online (Sandbox Code Playgroud)

java android textview android-recyclerview

3
推荐指数
1
解决办法
8502
查看次数

标签 统计

android ×1

android-recyclerview ×1

java ×1

textview ×1