错误,调试

1. 在httpConn.connect();时原来正常,但又遇到会报Host is unresolved错误,重新运行模拟器可能会解决。

    常在分辨率升高时出现。??

2.HttpUrlConnection.setRequestProperty();后,实际请求的内容中,头关键字被小写了。??

   遇到同样问题的 http://hi.baidu.com/jiawei_liu/blog/item/3997b002f1e2bf0a1c95836d.html#0

3.CookieSyncManager.setCookie()常不起作用,但在它执行前断点或者睡眠能解决。??

4.i7680上如果使用new出来的TextView或WebView,输入框可能会弹不出来,改为在xml中配置可解决。

5.emulator-5554 disconnected! Cancelling

    尝试window -> Show Views -> Other -> Android -> device -> view menu -> Reset adb

     http://www.cnblogs.com/over140/archive/2010/08/06/1793264.html

   或者尝试 debug configrations,勾上Wipe User Data.或者 加参数 -wipe-data

  http://dev.10086.cn/cmdn/bbs/redirect.php?tid=1420&goto=lastpost

6.执行Drawable drawable =getResources().getDrawable(R.drawable.seperate);时出错

查看LogCat中的打印,发现

12-17 05:10:25.534: WARN/ResourceType(463): getEntry failing because entryIndex 12 is beyond type entryCount 12

12-17 05:10:25.534: WARN/ResourceType(463): Failure getting entry for 0x7f02000c (t=1 e=12) in package 0: 0x80000001

清理重新编译解决。

7.android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@453e05d0 is not valid; is your activity running?

导致报这个错是在于new AlertDialog.Builder(mcontext),虽然这里的参数是AlertDialog.Builder(Context context)但不能使用getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。

使用getLocalActivityManager启动的activity也不行。

可以用以下代码解决:

privateContext getDialogContext(){    Context context;    if(getParent()!=null) context= getParent();    else context=this;    return context;}

 

8.Android 的调试信息分为五类: 
  VERBOSE 类型调试信息,verbose啰嗦的意思
  DEBUG 类型调试信息, debug调试信息
  INFO  类型调试信息, 一般提示性的消息information
  WARN  类型调试信息,warning警告类型信息
  ERROR 类型调试信息,错误信息

  在LogCat中,选择显示级别表示最低的显示级别,而不是只显示这一级别。

9. android模拟器中FileExplorer不显示问题
    方法1:打开DDMS模式,找到左上角的Devices模块,下面的图标从右往左第二个图标,上面写着STOP的标记,一般界面不显示的原因都是由于它启动的原因,停止它,然后会看到FileExplorer和LogCat都正常显示了。
 方法2:重启虚拟机。
方法3:重启Eclipse和虚拟机。

 

10. 更新代码后编译报:AndroidManifest.xml does not declare a Java package: Build aborted.

      刷新工程后编译。

 

11. 在Android tools/Export...,生成导出安装文件时,报 Conversion to Dalvik format failed with error 1

      在D:\android-sdk_r10-windows\tools\proguard\bin目录找到proguard.bat,把
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
改为:
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9


      http://hp.dewen.org/?p=420

      http://hsx9566.iteye.com/blog/1142002

 

12.截屏

     连接真机,在DDMS的Devices面板中,点击照相机图标screen capture,

http://www.ruan8.com/tutorial_610.html

 

 

 


 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值