inserting data in sqlite database errors

前端 未结 2 629
梦如初夏
梦如初夏 2021-01-27 11:07

i am trying to get the answers from a form in an application with android. here is the code i used :

       package com.stage.sondage;



      import android.ap         


        
相关标签:
2条回答
  • 2021-01-27 11:26
          after seeing your log there is null pointer exception in below class
    
           **public class Questionnaire extends Activity**  ..at line nuber 53 or 54 
            you may to see that line your class and debugg and see which object value
             coming as null and fix it 
    
    0 讨论(0)
  • 2021-01-27 11:49

    The error is in (com.stage.sondage.Questionnaire.onCreate(Questionnaire.java:54)), can you indicate which line is this?

    another thing, in the following part mRadioGroup should vary right? mRadioGroup1, mRadioGroup2,..etc:

    RadioButton b1 = (RadioButton)findViewById(mRadioGroup1.getCheckedRadioButtonId());
    appreciation.setRep1((String) b1.getText());
    RadioButton b2 = (RadioButton)findViewById(mRadioGroup1.getCheckedRadioButtonId());
    appreciation.setRep1((String) b2.getText());
    RadioButton b3 = (RadioButton)findViewById(mRadioGroup1.getCheckedRadioButtonId());
    appreciation.setRep1((String) b3.getText());
    RadioButton b4 = (RadioButton)findViewById(mRadioGroup1.getCheckedRadioButtonId());
    appreciation.setRep1((String) b4.getText());
    RadioButton b5 = (RadioButton)findViewById(mRadioGroup1.getCheckedRadioButtonId());
    appreciation.setRep1((String) b5.getText());
    
    0 讨论(0)
提交回复
热议问题