verificacion opcion insertar formularios formulario controles control casilla botones boton android android-edittext textview radio-button checkboxlist

android - opcion - insertar casilla de verificacion en excel 2016



Obtenga todo el botón de opción seleccionado y el valor de casilla de verificación creado dinámicamente? (1)

No sé Android. Pero el problema me surge en struts2. Solucioné ese problema generando una casilla de verificación dinámica como la de abajo.

<s:iterator value="samplelist"> <input type="checkbox" value="true" style="margin-top:2px;" name="p_<s:property value=''profileId''/> </s:iterator>

así que he descubierto si está marcado o no en código java utilizando el bucle for

for(int i=0;i<samplelist.size();i++) request.getParameter("P_something");

Quiero guardar todas las respuestas seleccionadas (casilla de verificación y botón de radio) y su pregunta correspondiente, que está configurada en vista de texto dinámica en sqlite db, pero el problema es cuando hago clic en "Guardar botón". El último valor seleccionado se guarda en sqlite. no todo el valor seleccionado y tampoco puede obtener todo el valor de casilla de verificación seleccionado.
Por favor, ayúdame .

save= (Button) findViewById(R.id.save); save.setOnClickListener(this); ll = (LinearLayout) findViewById(R.id.linearLayout1); for (int j = 0; j < Questions.length; j++) { tv = new TextView(this); tv.setId(j); tv.setText(Questions[j].getQuestionNo() + "." + Questions[j].getQuestion()); ll.addView(tv); Answer[] answer = Questions[j].getAnswer(); if (Questions[j].getMultipleChoice().equalsIgnoreCase("false")) { rg = new RadioGroup(this); rg.setOrientation(RadioGroup.VERTICAL); RadioButton[] rb = new RadioButton[answer.length]; for (int i = 0; i < answer.length; i++) { // add radio buttons rb[i] = new RadioButton(this); rb[i].setText(answer[i].getLabel()); int id = Integer.parseInt(j + "" + i); rb[i].setId(id); rg.addView(rb[i]); } ll.addView(rg); else { // add checkboxes for (int i = 0; i < answer.length; i++) { cb = new CheckBox(this); cb.setText(answer[i].getLabel()); int id = Integer.parseInt(j + "" + i); cb.setId(id); ll.addView(cb); } } } public void onClick(View v) { switch (v.getId()) { case R.id.save: if (rg.getCheckedRadioButtonId() != -1) { int id = rg.getCheckedRadioButtonId(); View radioButton = rg.findViewById(id); int radioId = rg.indexOfChild(radioButton); RadioButton btn = (RadioButton) rg.getChildAt(radioId); String answer = (String) btn.getText(); //only last selected radio button value is coming } // not able to get all the selected checkbox value break; default: break; } }