public void commandAction(Command c, Displayable d) {

        if (c == CMD_RESTART) {
            this.midlet.startApp();
            return;
        }

        if (c == CMD_CONTINUE) {
            districtField = new ChoiceGroup("Votre District:", ChoiceGroup.POPUP,
                                            snisi.entities.Utils.districts_names(regions[regionField.getSelectedIndex()]), null);
            append(districtField);
            removeCommand(CMD_CONTINUE);
            addCommand(CMD_CONTINUE_2);
            addCommand(CMD_RESTART);
        }

        if (c == CMD_CONTINUE_2) {
            district_code = snisi.entities.Utils.districts_codes(regions[regionField.getSelectedIndex()])[districtField.getSelectedIndex()];

            health_centerField = new ChoiceGroup("Aire de santé:", ChoiceGroup.POPUP,
                                                 snisi.entities.Utils.hcenters_names(district_code), null);
            append(health_centerField);
            removeCommand(CMD_CONTINUE_2);
            addCommand(CMD_CONTINUE_3);
        }

        if (c == CMD_CONTINUE_3) {
            System.out.println("District: "+ district_code + " Aire sanitaire: " + health_center_code);
            health_center_code = snisi.entities.Utils.hcenters_codes(district_code)[health_centerField.getSelectedIndex()];
            locationField = new ChoiceGroup("Village:",ChoiceGroup.POPUP,
                                        snisi.entities.Utils.villages_names(district_code,
                                        health_center_code), null);

            try {
                village_name = snisi.entities.Utils.villages_names(district_code,
                                                                   health_center_code)[locationField.getSelectedIndex()];
                village_code = snisi.entities.Utils.villages_codes(district_code,
                                                                   health_center_code)[locationField.getSelectedIndex()];
                System.out.println(village_code);
                append(locationField);
                removeCommand(CMD_CONTINUE_3);
            } catch (Exception e) {
                Alert alert;
                alert = new Alert("Village non trouver", "Aucun village n'a "
                                  + "été trouvé pour l'aire de santé de "
                                  + snisi.entities.Utils.hcenters_names(district_code)[health_centerField.getSelectedIndex()]
                                  + "/" + health_center_code
                                  + ".", null,
                                   AlertType.INFO);
                alert.setTimeout(Alert.FOREVER);
                this.midlet.display.setCurrent (alert, this);

                // System.out.println(village_code);
                return;
            }
            addCommand(CMD_DISPLAY);
        }
                // save command
        if (c == CMD_DISPLAY) {
            Alert alert;
            String sep = " | ";
                alert = new Alert ("Voici votre selection",
                                   "Region "+ sep + "code \n"
                                   + snisi.entities.Utils.regions_names()[regionField.getSelectedIndex()]
                                   + sep + snisi.entities.Utils.regions_codes()[regionField.getSelectedIndex()]
                                   + "\nDistrict "+ sep + "code\n"
                                   + snisi.entities.Utils.districts_names(regions[regionField.getSelectedIndex()])[districtField.getSelectedIndex()]
                                   + sep + district_code
                                   + "\nAire de santé "+ sep + "code\n"
                                   + snisi.entities.Utils.hcenters_names(district_code)[health_centerField.getSelectedIndex()]
                                   + sep + health_center_code
                                   + "\nVillage "+ sep + "code \n"
                                   + village_name + sep + village_code,
                                   null, AlertType.INFO);
                this.midlet.display.setCurrent (alert, this);
        }

       if (c == CMD_EXIT) {
           this.midlet.destroyApp(false);
           this.midlet.notifyDestroyed();
       }
    }