混淆android复选框

混淆android复选框,android,Android,我想在选择单选按钮后使用复选框实现产品列表。 我想将chekclistbox显示为对话框。我的产品列表数据来自sqllite。 需要实现适配器类来显示checklistbox的数据,或者可以在alertDialog中直接实现checklistbox的数据。请帮我澄清一下 主要活动 public RadioGroup.OnCheckedChangeListener setOnCheckedChangeListener = new OnCheckedChangeListener() { @O

我想在选择单选按钮后使用复选框实现产品列表。 我想将chekclistbox显示为对话框。我的产品列表数据来自sqllite。 需要实现适配器类来显示checklistbox的数据,或者可以在alertDialog中直接实现checklistbox的数据。请帮我澄清一下

主要活动

public RadioGroup.OnCheckedChangeListener setOnCheckedChangeListener = new OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
        rdoPCode = (RadioButton) findViewById(checkedId);
        switch (checkedId) {
        case R.id.rdoAll:
            Toast.makeText(context, rdoPCode.getText(), Toast.LENGTH_SHORT)
                    .show();
            break;
        case R.id.rdoCustom:
            Intent localIntent = new Intent(MainActivity.context,
                    ProductListChkActivity.class);
            MainActivity.context.startActivity(localIntent);                
            break;
        }
    }
};
在ProductListChkaActivity中

public class ProductListChkActivity extends Activity {

private static Button button_selectall;
private static Button button_unselectall;
private static CheckBox chkProductCode;

private static CashSaleProductLogic _sellProductLogic;
public static List<CashSaleProductInfo> _SaleProductInfo;

public static ListView lvlchkPrdlist;
private Button btnSelectAll, btnUnSelectAll;

// For chk productcode
private static ProductListChkAdapter _ProductListChkAdapter;
Context context;

@Override
protected void onCreate(Bundle paramBundle) {
    super.onCreate(paramBundle);
    setContentView(R.layout.productinofchk);

    context = this;

    init();

    ProductCodeChk();
}

private void init() {
    button_selectall = (Button) this.findViewById(R.id.button_selectall);
    button_unselectall = (Button) this
            .findViewById(R.id.button_unselectall);
    chkProductCode = (CheckBox) this.findViewById(R.id.chkProductCode);
    lvlchkPrdlist = (ListView) this.findViewById(R.id.lvlchkPrdlist);

    _sellProductLogic = new CashSaleProductLogic(this);
    _SaleProductInfo = _sellProductLogic.getAllsellProductDataLogic();
}

protected void ProductCodeChk() {
    try {

        _ProductListChkAdapter = new ProductListChkAdapter(context,
                _SaleProductInfo, 1);
        this.lvlchkPrdlist.setAdapter(_ProductListChkAdapter);      

    } catch (Exception e) {
        e.printStackTrace();
        return;
    }
}

public void OnClickbillbtncancel(View paramView) {
    MainActivity.textClear();
    Intent localIntent = new Intent(ProductListChkActivity.this,
            MainActivity.class);
    ProductListChkActivity.this.startActivity(localIntent);
}
公共类ProductListChkaActivity扩展活动{
专用静态按钮\u选择全部;
私有静态按钮\u取消选择全部;
私有静态复选框chkProductCode;
私有静态CashSaleProductLogic\u sellProductLogic;
公共静态列表_SaleProductInfo;
公共静态列表视图lvlchkPrdlist;
专用按钮BTSELECTALL、btnUnSelectAll;
//对于chk productcode
私有静态ProductListChkAdapter\u ProductListChkAdapter;
语境;
@凌驾
创建时受保护的void(Bundle参数Bundle){
super.onCreate(paramBundle);
setContentView(R.layout.productinofchk);
上下文=这个;
init();
ProductCodeChk();
}
私有void init(){
button\u selectall=(button)this.findViewById(R.id.button\u selectall);
按钮\取消选择全部=(按钮)此
.findViewById(R.id.按钮\u未选中);
chkProductCode=(复选框)this.findViewById(R.id.chkProductCode);
lvlchkPrdlist=(ListView)this.findViewById(R.id.lvlchkPrdlist);
_sellProductLogic=新的CashSaleProductLogic(此);
_SaleProductInfo=\u sellProductLogic.getAllsellProductDataLogic();
}
受保护的无效ProductCodeChk(){
试一试{
_ProductListChkAdapter=新产品ListChkAdapter(上下文,
_SaleProductInfo,1);
这个.lvlchkPrdlist.setAdapter(_productListChkaAdapter);
}捕获(例外e){
e、 printStackTrace();
返回;
}
}
public void OnClickbillbtncancel(视图参数视图){
MainActivity.textClear();
Intent localIntent=新的Intent(productListChkaActivity.this,
主要活动(课堂);
ProductListchKaActivity.this.startActivity(LocalContent);
}
}


我想将productinofchk布局显示为对话框

您需要在android中通过浮动对话框。查看以下文档:


您应该使用自定义布局文件,并在AlertDialog中充气。您的问题我一个字也听不懂。请组织您的帖子,设置一点格式,并展示您到目前为止所做的工作。这是对话,而不是对话:)