Android 异常解决办法

来源:互联网 发布:微信加人软件 编辑:程序博客网 时间:2024/06/17 07:10

1.android.content.res.Resources$NotFoundException: String resource ID #0x4

  • 会出现在需要String数据的地方传入int的时候遇到。
    比如:
TextView title = (TextView) convertView.findViewById(R.id.question_paper_pop_type);TextView realScore = (TextView) convertView.findViewById(R.id.question_paper_pop_realscore);title.setText(item.getName());realScore.setText(item.getRealScore()+"");//*这里*

title是需要String,所以没有问题。realScore需要的是String类型,然而item.getRealScore()int所以会出错,因此修改为item.getRealScore()+""就没有问题。

java.lang.OutOfMemoryError

一般是在显示bitmap的时候产生。

stackoverflow上的解决办法

0 0
原创粉丝点击