mardi 2 mai 2017

How to check CheckBox with condition? [duplicate]

This question already has an answer here:

Hello i am try to making application get data json from server, and i parse it and if variabel reksupx is equal t then, the checkbox is checked automatically. The json is alright, i have check it from System.out.println, but why checkbox can't checked? thanks in advance.

This is my code :

if(reksup1=="t"){
                                    check1.setChecked(true);
                                    check2.setChecked(false);
                                    check3.setChecked(false);
                        }
                        else if(reksup2=="t"){
                                    check1.setChecked(false);
                                    check2.setChecked(true);
                                    check3.setChecked(false);
                        }
                        else if(reksup3=="t"){
                                    check1.setChecked(false);
                                    check2.setChecked(false);
                                    check3.setChecked(true);

                        }




Aucun commentaire:

Enregistrer un commentaire