我有一个自定义游标适配器,其中每行包含一个复选框,文本视图和按钮.该按钮最初设置为GONE,当用户选中我希望按钮显示的复选框时,用户可以单击它并删除相应的行.
我的问题是,在我的getView()中,我无法获得正确的光标,所以不断获取cursorOutOfBoundsExceptions.
如果我不再需要它,我也想删除bindView().
public class DeleteCampaignCustomCursorAdapater extends CursorAdapter {
protected static final String TAG = null;
DatabaseHelper myDbHelper;
protected SQLiteDatabase db;
private final Activity context;
private LayoutInflater mInflater;
protected ListView mListView;
private Cursor c;
public static int[] checked;
TextView merchantNameView;
Button deleteButton;
CheckBox selectForDelete;
//ImageView moveButton;
public DeleteCampaignCustomCursorAdapater(Context context, Cursor c) {
super(context, c);
this.context = (Activity) context;
mInflater = LayoutInflater.from(context);
this.c = c;
initializeChecked();
}
@Override
public void bindView(View view, Context context, final Cursor cursor) {
/*myDbHelper …Run Code Online (Sandbox Code Playgroud)