Android Resources$NotFoundException异常
来源:互联网 发布:淘宝信用贷款还款 编辑:程序博客网 时间:2024/06/05 11:19
异常信息:
问题源码:
public class MainActivity extends AppCompatActivity { private static TextView mTime; private MyHandler mHandler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTime = (TextView)findViewById(R.id.time_view); mHandler=new MyHandler(); } static class MyHandler extends Handler{ @Override public void handleMessage(Message msg) { super.handleMessage(msg); int t = msg.arg1; mTime.setText(t); } } public void btnClick(View view) { new Thread(new Runnable() { @Override public void run() { for (int i = 0; i < 10; i++) { try { Message m = mHandler.obtainMessage(); Thread.sleep(1000); m.arg1=i; mHandler.sendMessage(m); } catch (InterruptedException e) { e.printStackTrace(); } } } }).start(); }}
只用在handlerMessage中的代码修改为mTime.setText(String.valueOf(t))即可。
0 0
- Android Resources$NotFoundException异常
- android.content.res.Resources$NotFoundException 异常处理
- android.content.res.Resources$NotFoundException异常处理
- android.content.res.Resources$NotFoundException异常处理
- Android异常处理之android.content.res.Resources$NotFoundException
- android.content.res.Resources$NotFoundException: String resource ID异常总结
- 异常/AndroidRuntime(22850): android.content.res.Resources$NotFoundException: Stri
- 解决Android.content.res.Resources$NotFoundException: File res/layout/...异常
- android.content.res.Resources$NotFoundException
- android.content.res.Resources NotFoundException
- android.content.res.Resources$NotFoundException
- android.content.res.Resources$NotFoundException
- android.content.res.Resources$NotFoundException:
- android.content.res.Resources$NotFoundException:
- android.content.res.Resources$NotFoundException
- android.content.res.Resources$NotFoundException
- [Android]Resources NotFoundException的解决
- android.content.res.Resources$NotFoundException
- C++模板板块
- Python学习笔记(三)
- MyVector
- ios开发之抽屉效果图
- title: 如何生成多个ssh并将hexo博客布置到github
- Android Resources$NotFoundException异常
- linux下安装apache(httpd-2.4.3版本)各种坑
- 【数位DP】CF55D BZOJ3329 HDU4352 SGU390 HDU5519
- leetcode 7. Reverse Integer
- leetcode 8. String to Integer (atoi)
- Android本地数据安全尝试(中)——Conceal
- 曲线
- leetcode 9. Palindrome Number
- 326. Power of Three