Android开发错误信息与解决方案汇总

来源:互联网 发布:流星搜剑录激活码淘宝 编辑:程序博客网 时间:2024/05/20 16:34
 
 

                Thread t = new Thread() {@Overridepublic void run() {super.run();try {QuestionItemlist = quesHandler.getData();if (QuestionItemlist.size() == 0) {Toast.makeText(questionitemlist2.this,"问卷题目为空",Toast.LENGTH_LONG).show();} else {Toast.makeText(questionitemlist2.this,"问卷题目已经获取",Toast.LENGTH_LONG).show();}} catch (Exception e) {e.printStackTrace();}}};t.start();

【错误信息】
java.lang.IllegalArgumentException: The key must be an application-specific resource id.
原因及解决办法:
mRadioButton.setTag(1,sQuestionItem.get(i).getToNext());//设置监听  ToNext:下一题目mRadioButton.setTag(2,sQuestionItem.get(i).getToEnd());//设置监听  ToEnd:是否终止抛出IllegalArgumentException的原因就在于key不唯一,正确代码如下:
mRadioButton.setTag(R.id.tag_tonext,sQuestionItem.get(i).getToNext());//设置监听  ToNext:下一题目mRadioButton.setTag(R.id.tag_toend,sQuestionItem.get(i).getToEnd());//设置监听  ToEnd:是否终止
【错误信息】
点击Debug 运行 结果模拟器总是会弹出Waiting for Debugger 然后程序又可以正常运行
如果你想调试的时候去掉 Waiting for Debugger 提示
原因及解决办法:
重启启动机器就OK