当前位置: 编程技术>移动开发
本页文章导读:
▪基础稿子汇总 基础文章汇总
基础知识http://eosite.iteye.com/blog/354248Java编程最差实践http://macrochen.iteye.com/blog/1393502Java编程中“为了性能”尽量要做到的一些地方http://www.iteye.com/magazines/66
......
▪ 播发gif动画 播放gif动画
// 设定位置和大小
CGRect frame = CGRectMake(50,50,0,0);
frame.size = [UIImage imageNamed:@"anim.gif"].size;
// 读取gif图片数据
NSData *gif = [NSData dataWithContentsOfFile:
[[NSBundle mainBundle] pathForResource.........
▪ 不能创造处理器 Can't create handler inside thread that has not called Looper.prepare() 不能创建处理器 Can't create handler inside thread that has not called Looper.prepare()
Android 2.3.3
Eclipse Version: 3.7.0
LogCat
LogCat 报错信息:
02-06 15:07:52.794: WARN/dalvikvm(503): threadid=18: thread exiting wi.........
[1]基础稿子汇总
来源: 互联网 发布时间: 2014-02-18
基础文章汇总
基础知识
http://eosite.iteye.com/blog/354248
Java编程最差实践
http://macrochen.iteye.com/blog/1393502
Java编程中“为了性能”尽量要做到的一些地方
http://www.iteye.com/magazines/66
基础知识
http://eosite.iteye.com/blog/354248
Java编程最差实践
http://macrochen.iteye.com/blog/1393502
Java编程中“为了性能”尽量要做到的一些地方
http://www.iteye.com/magazines/66
[2] 播发gif动画
来源: 互联网 发布时间: 2014-02-18
播放gif动画
// 设定位置和大小 CGRect frame = CGRectMake(50,50,0,0); frame.size = [UIImage imageNamed:@"anim.gif"].size; // 读取gif图片数据 NSData *gif = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"anim" ofType:@"gif"]]; // view生成 UIWebView *view = [[UIWebView alloc] initWithFrame:frame]; [view loadData:gif MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
[3] 不能创造处理器 Can't create handler inside thread that has not called Looper.prepare()
来源: 互联网 发布时间: 2014-02-18
不能创建处理器 Can't create handler inside thread that has not called Looper.prepare()
Android 2.3.3 Eclipse Version: 3.7.0 LogCat
LogCat 报错信息:
02-06 15:07:52.794: WARN/dalvikvm(503): threadid=18: thread exiting with uncaught exception (group=0x40015560) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): FATAL EXCEPTION: Thread-49 02-06 15:07:52.815: ERROR/AndroidRuntime(503): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at android.os.Handler.(Handler.java:121) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at android.app.Activity.(Activity.java:680) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at android.app.ListActivity.(ListActivity.java:175) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at android.preference.PreferenceActivity.(PreferenceActivity.java:76) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at com.tmall.iphone4s.manage.Preference.(Preference.java:62) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at com.tmall.iphone4s.Check.run(Check.java:297) 02-06 15:07:52.815: ERROR/AndroidRuntime(503): at java.lang.Thread.run(Thread.java:1019) 02-06 15:07:52.864: WARN/ActivityManager(61): Force finishing activity com.tmall.iphone4s/.PlayAd
发生错误原因:线程内未调用Looper.prepare(),不能创建处理器。
解决办法:在线程Check的run()中加入 Looper.prepare();
public void run() { // TODO Auto-generated method stub super.run(); Looper.prepare(); setting = new Preference(context); check(); }
最新技术文章: