当我的启动屏幕启动时,我在logcat中得到此错误:
11-06 02:36:45.450: E/global(4184): Deprecated Thread methods are not supported.11-06 02:36:45.450: E/global(4184): java.lang.UnsupportedOperationException11-06 02:36:45.450: E/global(4184): at java.lang.VMThread.stop(VMThread.java:85)11-06 02:36:45.450: E/global(4184): at java.lang.Thread.stop(Thread.java:1280)11-06 02:36:45.450: E/global(4184): at java.lang.Thread.stop(Thread.java:1247)11-06 02:36:45.450: E/global(4184): at com.example.kostas.splash.run(splash.java:38)
这是我的课:
public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.splash); // thread for displaying the SplashScreen Thread splashTread = new Thread() { @OverrIDe public voID run() { try { int waited = 0; while(_active && (waited < _splashTime)) { sleep(100); if(_active) { waited += 100; } } } catch(InterruptedException e) { // do nothing } finally { finish(); startActivity(new Intent("com.example.kostas.main")); stop(); } } }; splashTread.start(); } @OverrIDe public boolean ontouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { _active = false; } return true; }
第38行是stop();
我的应用程序启动没有问题,但我想修复它..我试图删除“ stop();”但我也遇到另一个错误.
11-06 02:44:56.321: E/(32599): onResume() check 011-06 02:44:56.321: E/(32599): onResume() check 111-06 02:44:56.321: E/Launcher(32599): setwindowOpaque()11-06 02:44:56.341: E/(32599): onResume() check 2, mRestoring : false11-06 02:44:56.341: E/(32599): onResume() check 311-06 02:44:56.341: E/(32599): onResume() check 411-06 02:44:56.345: E/(32599): onResume() check 5
谢谢
解决方法:
答案是在错误消息中:不建议使用Thread.stop(),AndroID不支持不建议使用的方法.
也许您可以尝试在onCreate中使用Thread.sleep()来代替超时.
总结以上是内存溢出为你收集整理的启动画面启动时出现java.lang.UnsupportedOperationException全部内容,希望文章能够帮你解决启动画面启动时出现java.lang.UnsupportedOperationException所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)