E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Looper.prepare
Android 线程
Looper.prepare
()、Looper.loop();
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(messageloop)的,需要调用
Looper.prepare
()来给线程创建一个消息循环,调用Looper.loop
xhl86xhl
·
2014-06-04 16:00
android can't create handler inside thread that has not called
Looper.prepare
()解决方案
安卓不能在线程中操作ui所以我在线程中操作UI时候就会报错后来发现在操作ui那个前后加上
Looper.prepare
(); Looper.loop();eg:
Looper.prepare
(); Toast.makeText
shipeng22022
·
2014-06-04 14:00
java.lang.RuntimeException:Can‘t create handler inside thread that has not called
Looper.prepare
()
用handler时,出现这个异常。handler的创建需要在主线程中,当在子线程中创建handler时会报这个错误我是在子线程中创建Toast时报错的参考http://blog.csdn.net/stonecao/article/details/6417364http://www.oschina.net/question/163910_31439
yaosong227
·
2014-05-21 14:37
android
handler
handler消息处理机制
如果想让该线程具有消息队列和消息循环,并具有消息处理机制,就需要在线程中首先调用
Looper.prepare
()来创建消息队列,然后调用Lo
恢恢88
·
2014-04-29 13:50
android
process
public
Can't create handler inside thread that has not called
Looper.prepare
()解决办法
转于:http://blog.csdn.net/a7a9a68/article/details/7841762 ----------------------------------------------------------------------------------- [java] view plain copy private&
原动力Java
·
2014-04-23 13:00
handler
子线程中使用Toast或者更新UI
Toast只能在主UI线程使用,使用下面的办法可以解决第一种,使用Looper,不过这种办法会终止,子线程之后的代码
Looper.prepare
(); Toast.makeText(aActivity.this
zcj331
·
2014-04-11 13:00
android之Can't create handler inside thread that has not called
Looper.prepare
()
好久没遇到这种错误,最初都是因为在新开的线程中更新UI才出错,后来一直没忘记用handler,也就没用错误,今天有出现如下错误,代码如下:send.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //TODOAuto-generatedmethodstub newThread(newRunn
jason0539
·
2014-03-13 22:00
thread
android
UI
Looper.prepare
()
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(messageloop)的,需要调用
Looper.prepare
()来给线程创建一个消息循环,调用Looper.loop
chenaini119
·
2014-03-07 15:00
android
[Android] android的消息队列模型
如果想让该线程具有消息队列和消息循环,并具有消息处理机制,就需要在线程中首先调用
Looper.prepare
()来创建消息队列,然后调用Loope
枫兮兮
·
2014-02-24 17:00
java.lang.RuntimeException: Can't create handler inside thread that has not called
Looper.prepare
()
在Android中不允许Activity里新启动的线程访问该Activity里的UI组件,这样会导致新启动的线程无法改变UI组件的属性值。出现java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare()异常然而,我们实际需要,在很多时候都需要异步获取数据刷新UI控件,这时候采取的方
wsyjx22
·
2014-02-11 11:00
android
异常
Android-java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.pr
遇到这个异常看了很多文章也还是不太清楚具体是什么原因,但是处理这个问题是很简单的,如下代码:1234567891011@Overridepublicvoidrun(){ //前面代码省略
Looper.prepare
liyanlei5858
·
2014-01-10 15:00
android
线程
(转)详解Looper,及android消息机制
今天调用别人的代码时出现了Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare()的错误,经过一番调查,发现只需要在我新开的Thread里面先调用一次
Looper.prepare
gxj1680
·
2013-11-26 18:00
Android开发: 线程间消息通信 Looper 和Handler
Looper.prepare
()为当前的线程初始化消息队列,Looper.loop()启动一个消息队列。
yuzuolin
·
2013-11-23 13:40
android
开发
通信
android线程间消息处理机制(Looper、Handler和Message)
通常是:Handle定义在UI线程, 工作线程使用
Looper.prepare
,进行初始化消息队列,然后使用Handler发生消息回UI线程。
gybin
·
2013-11-20 15:00
android
深入理解 Looper & Handler 之间的关系
官方代码演示classLooperThreadextendsThread{ publicHandlermHandler; publicvoidrun(){
Looper.prepare
();
EREHMii
·
2013-11-11 17:00
android
handler
message
looper
messagequeue
Can't create handler inside thread that has not called
Looper.prepare
() 错误有关问题
AsyncTask中的doInBackground方法不可直接操作UI解决方法:在调用handler的方法前执行
Looper.prepare
()。Looper用于封装了android线程中的
x1n_92
·
2013-11-07 11:00
java.lang.RuntimeException: Can't create handler inside thread that has not called
Looper.prepare
()
Looper.prepare
(); //开头 Builderbuilder=newBuilder(MyBurglarService.this); //这里我的MyBurglarService是我的一个线程
a740169405
·
2013-09-16 09:00
thread
android
service
dialog
服务
Android:Looper类,
Looper.prepare
()和Looper.loop()
工作线程:在android应用程序中,我们创建的Activity、Service、Broadcast等都是在主线程(UI线程)处理的,但一些比较耗时的操作,如I/O读写的大文件读写,数据库操作以及网络下载需要很长时间,为了不阻塞用户界面,出现ANR的响应提示窗口,这个时候我们可以考虑创建一个工作线程(继承Thread类或者实现Runnable接口)来解决。使用工作线程容易出现的问题:对于Andro
canlets
·
2013-08-23 11:00
android
Looper类
Looper.prepare
Looper.loop
Android中的Looper,Handler及HandlerThread简析
Can’t create handler inside thread that has not called
Looper.prepare
() 毕业后在深圳一家公司工作,目前公司在做的是与android
貌似掉线
·
2013-08-20 19:00
android
handler
looper
handlerthread
Android开发错误处理
界面的控件,否则会报错: Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare():非主线程中默认没有创建Looper对象,需要先调用
Looper.prepare
w575822446
·
2013-08-09 13:00
thread
多线程
error
Can't create handler inside thread that has not called
Looper.prepare
()
1. 收到新信息时,出现运行时异常。 07-16 10:58:55.173: E/JavaBinder(31934): *** Uncaught remote exception! (Exceptions are not yet supported across processes.) 07-16 10:58:55.173: E/JavaBinder(31934): java.lan
·
2013-07-16 11:00
handler
非UI线程中显示Alertdialog控件或Toast
privatevoidtoast(Stringcontent){ //TODOAuto-generatedmethodstub
Looper.prepare
(); Toast.makeText(Activity_Register.this
djun100
·
2013-07-08 16:00
Android --
Looper.prepare
()和Looper.loop() —深入版
Android中的Looper类,是用来封装消息循环和消息队列的一个类,用于在android线程中进行消息处理。handler其实可以看做是一个工具类,用来向消息队列中插入消息的。 (1)Looper类用来为一个线程开启一个消息循环。 默认情况下android中新诞生的线程是没有开启消息循环的。(主线程除外,主线程系统会自动为其创建Looper对象,开启消息循环。) Looper对象通过
heng615975867
·
2013-06-28 10:00
Android 线程
Looper.prepare
()、Looper.loop()
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(messageloop)的,需要调用
Looper.prepare
()来给线程创建一个消息循环,调用Looper.loop
heng615975867
·
2013-06-28 10:00
Android 中的消息循环简介
调用
Looper.prepare
()方法来创建消息循环,调用Looper.loop()方法来开始消息循环。下面代码示例了如何实现一个带有消息循环的线程类,这个线程类关联了一个Handler。
leehong2005
·
2013-06-19 12:00
android
handler
message
looper
Can’t create handler inside thread that has not called
Looper.prepare
()
问题:最近在做一个使用SIP通话的客户端。在程序启动的时候要启动蓝牙设备,以连接蓝牙耳机等。当在一个Thread中调用蓝牙初始化的方法时出现如下的错误:publicstaticvoidinit(){if(ba==null){ba=BluetoothAdapter.getDefaultAdapter();am=(AudioManager)Receiver.mContext.getSystemServ
scyatcs
·
2013-06-01 00:00
Android在非UI线程中显示Toast
阅读更多publicvoidshowToast(Stringmsg){
Looper.prepare
();Toast.makeText(getApplicationContext(),msg,Toast.LENGTH_SHORT
king_tt
·
2013-05-09 11:00
android
java
Windows
Mobile
三星
Android在非UI线程中显示Toast
publicvoidshowToast(Stringmsg){
Looper.prepare
(); Toast.makeText(getApplicationContext(),msg,Toast.LENGTH_SHORT
xiaanming
·
2013-05-09 11:00
toast
非UI线程
线程中显示Toast
Android在非UI线程中显示Toast
public void showToast(String msg){
Looper.prepare
(); Toast.makeText(getApplicationContext(), msg,
ydbc
·
2013-05-09 11:00
android
Android在非UI线程中显示Toast
public void showToast(String msg){
Looper.prepare
(); Toast.makeText(getApplicationContext(), msg
king_tt
·
2013-05-09 11:00
java
android
三星
Windows Mobile
Android在非UI线程中显示Toast
阅读更多publicvoidshowToast(Stringmsg){
Looper.prepare
();Toast.makeText(getApplicationContext(),msg,Toast.LENGTH_SHORT
king_tt
·
2013-05-09 11:00
android
java
Windows
Mobile
三星
Can't create handler inside thread that has not called
Looper.prepare
()的终极解决方法
异常:05-0511:55:10.842:E/AndroidRuntime(441):FATALEXCEPTION:Thread-805-0511:55:10.842:E/AndroidRuntime(441):java.lang.ExceptionInInitializerError05-0511:55:10.842:E/AndroidRuntime(441):atcom.demo.myimag
xue_wei_love
·
2013-05-06 11:00
Can't create handler inside thread that has not called
Looper.prepare
()
分析: 报的是一个Android Looper的错误,从字面意思上看是没有调用
Looper.prepare
()方法。 Looper是什么? Looper又是什么呢?
iaiai
·
2013-04-10 17:00
handler
Can't create handler inside thread that has not called
Looper.prepare
() 终极解决方法
E/AndroidRuntime(26639):Causedby:java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare()E/AndroidRuntime(26639):Causedby:java.lang.RuntimeException:Can'tcreatehandler
帝都春哥
·
2013-04-02 16:45
android
s
Android学习-Service中显示Toast
如果在没有looper的情况下可以调用
Looper.prepare
()来准备looper。
Main_Stage
·
2013-04-01 03:00
Looper与Handler是如何通过Message发生关系的
经常看到Android的消息用法大概为:
Looper.prepare
()Looper.myLooper();xxxHandler=newHandler(){ handleMessage(Messagemsg
huichengongzi
·
2013-03-27 15:00
Can't create handler inside thread that has not called
Looper.prepare
()解决办法
Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare()解决办法2012-08-0809:31 312人阅读 评论(0) 收藏 举报threadandroiduiintegeruserstring[java] viewplaincopyprivate Handler mHandler = new Handler(){
huanghuanghbc
·
2013-03-05 11:00
Looper与Handler是如何通过Message发生关系的
经常看到Android的消息用法大概为:
Looper.prepare
()Looper.myLooper();xxxHandler=newHandler(){ handleMessage(Messagemsg
lylianlll
·
2012-12-19 10:00
Can't create handler inside thre
像提示说的,添加<wbr>
Looper.prepare
();<wbr></wbr></wbr> Threadaction=newThread(){<
wsql
·
2012-12-11 16:00
handler
Android开发: 线程间消息通信 Looper 和Handler
Looper.prepare
()为当前的线程初始化消息队列,Looper.loop()启动一个消息队列。
whithin
·
2012-11-20 10:21
android
handler
message
looper
Can't create handler inside thread that has not called
Looper.prepare
() 终极解决方法
Causedby:java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare() 在报错的方法前加
Looper.prepare
changemyself
·
2012-10-28 19:00
Looper、Handler应用---实现主线程向子线程发送消息
的方法创建消息循环(主线程除外,主线程会自动为其创建Looper对象,开启消息循环),MessageQueue存放消息和事件 Handler类:辅助类,向绑定的Looper投递消息 Looper原型:
Looper.prepare
cyq1028
·
2012-10-17 14:00
thread
object
null
Class
Looper.prepare
()
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(messageloop)的,需要调用
Looper.prepare
()来给线程创建一个消息循环,调用Looper.loop
competerH_programing
·
2012-10-16 11:00
thread
android
api
Class
子线程中使用Toast或者更新UI(转)
Toast只能在主UI线程使用,使用下面的办法可以解决第一种,使用Looper,不过这种办法会终止,子线程之后的代码
Looper.prepare
(); Toast.makeText(aActivity.this
zoeice
·
2012-10-11 13:00
UI
NetWork
Looper.loop() android线程中的消息循环
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(messageloop)的,需要调用
Looper.prepare
()来给线程创建一个消息循环,调用Looper.loop
laoyang1018
·
2012-09-27 15:00
thread
android
api
null
Class
new Thread 内 new Handle
newThread(newRunnable( @Override publicvoidrun(){
Looper.prepare
(); newHandler(); } )).start();
playerc
·
2012-09-18 14:00
创建Handle
线程内
Looper.prepare
()
System.err(31649): java.lang.RuntimeException: Can't create handler inside thread that has not called
Looper.prepare
伈吢塌哋
·
2012-08-24 17:00
thread
android
三星
解决Can't create handler inside thread that has not called
Looper.prepare
() inside AsyncTask
classLoadDataextendsAsyncTask{ privateHandlermHandler=newHandler(Looper.getMainLooper()); @Override publicvoidrun(){ //... mHandler.post(newRunnable(){ publicvoidrun(){ } }); //
infsafe
·
2012-08-14 19:00
thread
Class
Android消息队列模型——Thread,Handler,Looper,Massage Queue
如果想让该线程具有消息队列和消息循环,并具有消息处理机制,就需要在线程中首先调用
Looper.prepare
()来创建消息队列,然后调用Looper
fdaopeng
·
2012-08-14 11:00
thread
数据结构
android
UI
service
Class
Android-Looper类,
Looper.prepare
()和Looper.loop()
Android中的Looper类,是用来封装消息循环和消息队列的一个类,用于在android线程中进行消息处理。handler其实可以看做是一个工具类,用来向消息队列中插入消息的。(1)Looper类用来为一个线程开启一个消息循环。 默认情况下android中新诞生的线程是没有开启消息循环的。(主线程除外,主线程系统会自动为其创建Looper对象,开启消息循环。) Looper对象通过Me
dajian790626
·
2012-08-13 13:00
thread
android
工作
Class
文档
工具
上一页
3
4
5
6
7
8
9
10
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他