简体   繁体   中英

How to handle rating bar with recyclerview

I have a recylerview with a rating bar on each row and a submit button for each ratinbar. In which section of the adapter would I place the listener for this? I plan on storing the ratings in an SQLite table.

如果您引用提交按钮的侦听器,我会将其放在onBindViewHolder中

@Override public void onBindViewHolder(com.example.app.RecyclerAdapter.ViewHolder holder, int position) { Button submitBtn = holder.submitBtn; submitBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //do stuff here }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM