I don't know why but the isChecked() won't work, It says it can't resolve symbol. Is there anything I'm supposed to import. I'd also like to ask how you would change the text in a Textview thanks!
package xyz.ashraf.whoisdelasalle;
import android.view.View;
import android.widget.CheckBox;
/**
* Created by Ashraf on 3/2/2016.
*/
public class check_Button extends Pop_sallian{
CheckBox concern = (CheckBox) findViewById(R.id.concern);
CheckBox faith = (CheckBox) findViewById(R.id.faith);
CheckBox respect = (CheckBox) findViewById(R.id.respect);
CheckBox education = (CheckBox) findViewById(R.id.education);
CheckBox community = (CheckBox) findViewById(R.id.community);
int con = 0;
int fai = 0;
int res = 0;
int edu = 0;
int com = 0;
if (concern.isChecked()) {
con++;
}
if (faith.isChecked()) {
fai++;
}
if(respect.isChecked()){
res++;
}
if(education.isChecked()){
edu++;
}
if(community.isChecked()){
com++;
}
}
Aucun commentaire:
Enregistrer un commentaire