- 博客(2)
- 资源 (4)
- 收藏
- 关注
原创 Android SQLite 升级数据库,在原有数据库的基础上添加一列
原本以为很简单的问题,直接在原来创建数据库的语句中加上需要添加的列new_column,但是运行时发现,应用crash。原因是,原有数据库文件已经存在的情况下并不会重新创建数据库,也就是说此时数据库中并没有new_column列,这个时候,运行query()来查询数据库如果包括new_column列,就会导致应用crash。其实,SQLite提供了数据库升级的方法 onUpgrade(),只需要在
2016-05-30 16:52:52 4103
原创 修改AlertDialog 按钮的背景
AlertDialog 提供了下面的方法来获取Button对象:public Button getButton (int whichButton)Added in API level 3Gets one of the buttons used in the dialog.If a button does not exist in the dialog, null will be re
2016-05-30 16:14:27 1642
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人