How to create dynamic Spinner in Java

1
Hello, I have a question about how to create three interdependent dynamic spinners, ie create a first spinner named "Module", from the selected value the spinner "Sub module" display only the items referring to it and from of the value of the "Sub module" display the "Function" spinner items for the selected sub module. It would be the same problem of selecting the item from a Spinner called "Status" and the Spinner "City" display only the cities of the selected state.  The structure of the three tables in the database is as follows:

CREATE TABLE ANDROID_MODULO(
    ID_MODULO INTEGER PRIMARY KEY AUTOINCREMENT, 
    NMODULO VARCHAR(50)
);

CREATE TABLE ANDROID_SUBMODULO(
    ID_SUBMODULO INTEGER PRIMARY KEY AUTOINCREMENT, 
    ID_MODULO INT NOT NULL 
       REFERENCES ANDROID_MODULO 
       ON DELETE NO ACTION ON UPDATE NO ACTION,
    NSUBMODULO VARCHAR(50)
);

CREATE TABLE ANDROID_FUNCOES(
    ID_FUNCAO INTEGER PRIMARY KEY AUTOINCREMENT, 
    ID_MODULO INT NOT NULL 
        REFERENCES ANDROID_MODULO(ID_MODULO) 
        ON DELETE NO ACTION ON UPDATE NO ACTION,
    ID_SUBMODULO INT NOT NULL 
        REFERENCES ANDROID_SUBMODULO (ID_SUBMODULO) 
        ON DELETE NO ACTION ON UPDATE NO ACTION,
    NFUNCAO  VARCHAR(60)
);

I'm getting the value of the module and write the id of it in the table of Attendances, but in the display of the sub modules and functions I can not load the data correctly, thank you already.

    
asked by anonymous 06.03.2017 / 16:59

0 answers