1. Download bin to phone fail

Already installed the usb driver ,butdownloadbin to phone fail.Theprompt like"xxxCOM5 xxx error...", it maybe caused by COM port conflict with other APP or otherdriver. So you can change the COM num to unused num to resolve this problem. such like change COM5to COM50.

2. App force close or occur fatal error.

Analysis the dump file, search the "exception" keyword in dump_state_xxx dump file. And you can see one line contained the keyword like "Fatal main", bellow the searched line, you can see the call stack, and the place where cause the force close.

3. Checkbox have no touch tone.

Maybe this is Android platform's bug. when tap the checkbox icon, there is no touch tone. I have checked the source code, found that even if there have implemented the onClickListener of the view, when touch the view will play touch tone. Button and listview all use view.onClickListener listen the key event.But Checkbox use CompoundButton.OnCheckedChangeListener listen key event, so when touch the checkbox icon, viewclass invoke onKeyUp to handle the key event ,in this callback function checked that the onClickListener is null, so not play the touch tone. If you want your checkbox have touch tone, you should addview.playSoundEffect(int) inyour own implementedonCheckedChanged()functionof your CompoundButton.OnCheckedChangeListener.

4. UI thread blocked

Can't refresh UI component in other thread except UI thread.Service runs in UI thread, so should not do much time-consuming operation in Service component, such as connect with network waitting for server response or download data, this can block the UI thread, and make a bad user feel.

5. Caution null database pointer

db = SQLiteDatabase.openOrCreateDadabase(); may return null pointer because the database not create or open normally. So before use the db pointer, check whether the db is null or not is usefull. And after use of an opened database shouldfinally closethe database.

db = SQLiteDatabase.openOrCreateDadabase(); try{if(db == null || db.isOpen() == false)    return;db.execSQL();}catch(SQLException e){}finally{if(db != null)    db.close();}

6. Reference maybe different which returned in the different time

getSharedPreferences().edit().putString();getSharedPreferences().edit().commit();

line1 and line2 are point to different object, because getSharedPreferences().edit() willcreate a new Editer, getSharedPreferences().edit()be called twice so ganerate two different object. That cause the error, line1 and line2 operate to different object. theright code should be write as below:

SharedPreferences sprfs = getSharedPreferences().edit();//first get the original referencesprfs.putString();sprfs.commit();

7. Caution use equals method

equals must be usedbetweensame type object, if you compare different type of object, that's will cause error. Be caution!!! the wrong code like below:

EditText.getText().equals(String);

The right code should be as below:

EditText.getText().toString().equals(String);

8. String array maybe invalidate aftersystem language changed

If system language is English, When string arraycreated,it's content are consistent English. When the language change to Chinese,if not recreate the string array, it's content is still English, this will cause string displayed not according to the current language, cause error. To avoid this issue, when switch language , should recreate the string array. Normally, destroy the string array in onDestroy and recreate the string array in onCreate.

9.Exception in catch

there already occur out array bound excepton in try, but also not check the array bound in catch. What the hell...

10.buildandroid4.0occur java version error

build android4.0 and android2.3 need different java version, the android4.0 maybe need jdk1.6.0_25 version. If build android4.0 occur this error, please first check java version.

when installed new jdk version should change the jdk path in .bashrc, then run . ~/.bashrc to make the modify effective .

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 【Android基础】讲讲Android的事件分发机
  2. Android实现WebView删除缓存的方法
  3. android电话接听过程简单解析
  4. Android输入法弹出时覆盖输入框问题
  5. 浅谈Android下的Wifi&&安卓WIFI 移植
  6. Android(安卓)短信解析
  7. 【移动生活】Google项目副总裁安迪・鲁宾
  8. Android系列之广播
  9. Android模块开发框架 LiveData+ViewModel
  10. Android系统中的输入输出设备