随笔分类 -  android

onSaveInstanceState和onRestoreInstanceState触发的时机
摘要:先看Application Fundamentals上的一段话:Android calls onSaveInstanceState() before the activity becomes vulnerable to being destroyed by the system, but does not bother calling it when the instance is actually being destroyed by a user action (such as pressing the BACK key)从这句话可以知道,当某个activity变得“容易”被系统销毁时,该 阅读全文

posted @ 2012-06-06 15:44 奔跑的蜗牛, 阅读(92) 评论(0) 推荐(0)

Activity.startManagingCursor方法
摘要:1.这个方法使用的前提是:游标结果集里有很多的数据记录。所以,在使用之前,先对Cursor是否为null进行判断,如果Cursor != null,再使用此方法2.如果使用这个方法,最后也要用stopManagingCursor()来把它停止掉,以免出现错误。3.使用这个方法的目的是把获取的Cursor对象交给Activity管理,这样Cursor的生命周期便能和Activity自动同步,省去自己手动管理。 阅读全文

posted @ 2012-06-06 15:12 奔跑的蜗牛, 阅读(108) 评论(0) 推荐(0)

导航