While click the button i have added a checkbox, finally need to get the all checked checkbox value by means of clicking submit button,
This is my code
mIncrementButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.setMargins(20, 0, 0, 0);
CheckBox checkbox = new CheckBox(MainActivity.this);
checkbox.setLayoutParams(params);
mAllText.add(checkbox);
checkbox.setText("Checkbox" + j);
checkboxlayout.addView(checkbox);
j++;
Log.d("j", "--->" + j);
}
});
mGetTheVlue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.d("Inside Button", "Inside Burron" + mAllText.size());
for (int i = 0; i < mAllText.size(); i++) {
CheckBox check = mAllText.get(i);
if (check.isChecked()) {
AllCheckbox.add(check.getText().toString());
}
}
}
});
Now i need to check whether all checkbox are checked and need to get the values, Dont know whether this question is so old or not. but i dint get any solution from google kindly help to get the solution.
Thanks in advance.