1.进行模拟器调试时出现 Failed to install Remote_Monitoring.apk on device 'emulator-5554': timeout
解决办法:在Eclipse-->Window-->Preferences-->Android-->DDMS-->ADB connection time out (ms) 中将默认的5000ms改为10000ms或更长
2.当前工程出现红色感叹号
解决办法:可能是引用jar包的地址不正确,4.0以下引用的是lib文件夹内的地址,4.0就变成libs了
3.Failed to install Remote_Monitoring.apk on device 'emulator-5554': EOF
解决办法:关闭模拟器,重启模拟器
4.android.os.NetworkOnMainThreadException
解决办法:
当一个应用程序试图在它的主线程执行网络操作的时候就会抛出这个异常,将网络请求写在线程中或写到AsyncTask中
5.The content of the adapter has changed but ListView did not receive a notification make sure the content of your adapter is not modified from a background thread . but only from the UI thread
解决办法:
1.改变适配器Adapter内容时不要在后台线程中,必须在UI线程中处理,这点可以通过Handler传出来解决。
2.亲身经历,当你改变了适配器绑定的泛型List<T>的值时,比如泛型对象是list,你调用了list.clear(),一定要在主线程通知,也就是调用Adapter的notifyDataSetChanged()
6.Error receiving broadcast Intent { act=android.bluetooth.adapter.action.DISC
解决办法:在广播接收器的OnReceive函数中,将除了String action = intent.getAction() 的操作放到if语句中,保证广播接收器的不同ACTION不会处理相同的取函数代码
7.java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bluecomrfmeter/com.bluecomrfmeter.BlueComConnectActivity}: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10184 nor current process has android.permission.BLUETOOTH.
解决办法:在AndroidManifest.xml 中加上 <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> 权限