首页 > 移动平台 > 详细

java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@450b2f48 异常处理

时间:2014-08-14 19:37:09      阅读:1152      评论:0      收藏:0      [点我收藏+]

晕死的错误,改了半天也没想到是这样的原因,基础正要呀。。。

先看一下警告信息:

07-07 08:32:19.540: WARN/WindowManager(74): Failed looking up window
07-07 08:32:19.540: WARN/WindowManager(74): java.lang.IllegalArgumentException:Requested window android.os.BinderProxy@450b2f48 does not exist
07-07 08:32:19.540: WARN/WindowManager(74):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9293)
07-07 08:32:19.540: WARN/WindowManager(74):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9284)
07-07 08:32:19.540: WARN/WindowManager(74):     at com.android.server.WindowManagerService.relayoutWindow(WindowManagerService.java:2364)
07-07 08:32:19.540: WARN/WindowManager(74):     at com.android.server.WindowManagerService$Session.relayout(WindowManagerService.java:6782)
07-07 08:32:19.540: WARN/WindowManager(74):     at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:117)
07-07 08:32:19.540: WARN/WindowManager(74):     at com.android.server.WindowManagerService$Session.onTransact(WindowManagerService.java:6743)
07-07 08:32:19.540: WARN/WindowManager(74):     at android.os.Binder.execTransact(Binder.java:288)
07-07 08:32:19.540: WARN/WindowManager(74):     atdalvik.system.NativeStart.run(Native Method)

Java代码如下:

 

[java] view plaincopy
 
  1. public class MyActivity extends Activity implements Runnable {  
  2.     private static final int SEARCH_APP = 0;  
  3.     private ProgressDialog pd;  
  4.     private Handler mHandler = new Handler() {  
  5.         public void handleMessage(Message msg) {  
  6.             super.handleMessage(msg);  
  7.             if (msg.what == SEARCH_APP) {  
  8.                 pd.dismiss();  
  9.             }  
  10.         }  
  11.     };  
  12.   
  13.     public void onCreate(Bundle savedInstanceState) {  
  14.         super.onCreate(savedInstanceState);  
  15.         setContentView(R.layout.show_app_grid);  
  16.   
  17.         pd = ProgressDialog.show(this, "请稍候···", "正在搜索你所安装的程序···");  
  18.         Thread t = new Thread(this);  
  19.         t.start();  
  20.   
  21.     }  
  22.   
  23.     public void run() {  
  24.         try {  
  25.             Thread.sleep(3000);  
  26.         } catch (InterruptedException e) {  
  27.             e.printStackTrace();  
  28.         }  
  29.         mHandler.sendEmptyMessage(SEARCH_APP);  
  30.     }  
  31. }  

 

原因是语句Thread t = new Thread()没有谢参数,因为在实现多线时如果是实现的Runnable接口,必要Thread t = new Thread(Runnable runnable),所以把语句Thread t = new Thread()修改为Thread t = new Thread(this)运行就正确了。

java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@450b2f48 异常处理,布布扣,bubuko.com

java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@450b2f48 异常处理

原文:http://www.cnblogs.com/123ing/p/3912939.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!