安卓踩坑记录

windows下运行adb device无法查看到自己的设备

  1. 手机未开启开发者模式, 如何开启可参考:https://developer.android.com/studio/debug/dev-options.html

  2. 电脑未安装google USB驱动, 具体如何安装可参考:https://developer.android.com/studio/run/win-usb.html?hl=zh-cn

常见开发错误

  1. 写布局文件时错把View写成view(注意首字母大写),导致layoutinflater找不到相应的类
  2. 新建activity,service后忘记在manifest文件中添加相应的声明,导致组件无法启动.
  3. 开发fragment时,使用了系统的fragment和support包中的fragment manage
  4. 使用LinearLayout时忘记设置orientation属性
  5. webview中的图片有时能加载有时不能加载,可能是因为你对WebSettings设置了setBlockNetworkImage