小编Sra*_*ani的帖子

listview的项目点击监听器如果有复选框则无效

在此输入图像描述

这是我的列表,带有复选框和3个textviews.

这是listview的适配器类:

   package android.virtus;

   import android.content.Context;
   import android.view.LayoutInflater;
   import android.view.View;
   import android.view.ViewGroup;
   import android.widget.BaseAdapter;
   import android.widget.CheckBox;
   import android.widget.TextView;

public class Adapter extends BaseAdapter{

private Context context;

LayoutInflater inflater;

CheckBox box;
String textView1[], textView2[], textView3[];


public Adapter(Context c, CheckBox cb, String textView1[], String textView2[], String textView3[]) {

    this.context=c;
    this.box=cb;
    this.textView1=textView1;
    this.textView2=textView2;
    this.textView3=textView3;
}

@Override
public int getCount() {
    // TODO Auto-generated method stub
    return textView1.length;
}

@Override
public Object getItem(int arg0) {
    // TODO Auto-generated method stub
    return null;
}

@Override …
Run Code Online (Sandbox Code Playgroud)

android

2
推荐指数
1
解决办法
1966
查看次数

标签 统计

android ×1