AI杰克王 2014-10-09 17:31 采纳率: 0%
浏览 1940

空指针 不知空哪 大神求助!!!

10-09 16:32:51.083: E/AndroidRuntime(766): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.weightcount/com.example.weightcount.resultView}: java.lang.NullPointerException

相关代码:
public class resultView extends MainActivity {
private TextView resultView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.result1);
    resultView = (TextView)findViewById(R.id.result);
    Intent intent = getIntent();
     final String factorstr = intent.getStringExtra("one");


     final RadioButton radio1 =(RadioButton)findViewById(R.id.Sex_man);
    RadioButton radio2 =(RadioButton)findViewById(R.id.Sex_woman);
    RadioGroup radiogroup = (RadioGroup)findViewById(R.id.radiogroup);
    radiogroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup arg0, int arg1) {
             int factorstrint = Integer.parseInt(factorstr);
            // TODO Auto-generated method stub
            if(arg1==radio1.getId()){

                int weight = factorstrint-105 ;


                resultView.setText(weight+" ");
  • 写回答

1条回答

  • qq429205464 2014-10-10 02:47
    关注

    能调试不,在你认为不正常的地方加个断点调试下就知道啦,不能调就打印一下trace日志看走到哪里了

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序