Re: [問題] recyclerView怎麼控制外部layout

作者: nashyuuki (葛屁老師的藏鏡人)   2021-07-21 22:48:28
private OnClickListener onClickListener;
@Override
public void onBindViewHolder(@NonNull MyCartAdapter.ViewHolder holder,
int position)
{
holder.xxx.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if(onClickListener!=null)
{
onClickListener.onClick(View v);
}
}
});
public void setOnClickListener(OnClickListener listener)
{
onClickListener=listener;
}
public interface OnClickListener
{
void onClick(View v);
}

Links booklink

Contact Us: admin [ a t ] ucptt.com