Skip to content

Commit e734805

Browse files
authored
update md
1 parent f508614 commit e734805

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@
66

77
1.0.0 完成基本功能;
88
1.0.1 全局变量的作用域从之前强制public改成只要非private即可;
9-
1.0.1 修改 SaveHelper.bind(this, savedInstanceState)方法为SaveHelper.recover(this, savedInstanceState),只是重命名,
9+
1.0.2 修改 SaveHelper.bind(this, savedInstanceState)方法为SaveHelper.recover(this, savedInstanceState),只是重命名,
1010
以便于理解;
1111
去掉当内存被收回去调用recover方法时,却没有对应helper类会主动抛异常的情况,方便在BaseAcitviy 和 BaseFragment的
1212
onSaveInstanceState 和 onRestoreInstanceState 统一添加SaveHelper.save和SaveHelper.recover方法。
1313

1414

15+
引入方式,在app的gradle中加入下面依赖即可:
16+
17+
18+
compile 'com.noober:savehelper:1.0.2'
19+
compile 'com.noober:savehelper-api:1.0.2'
20+
annotationProcessor 'com.noober:processor:1.0.2'
21+
1522
# 引入
1623

1724
android 内存被回收是一个开发者的常见问题。当我们**跳转到一个二级界面,或者切换到后台**的时候,如果时间过长或者手机的**内存不足**,当我们再返回这个界面的时候,activity或fragment就会被内存回收。这时候虽然界面被重新执行了onCreate,但是很多变量的值却已经被置空,这样就导致了很多潜在的bug,已经很多空指针的问题。
@@ -222,11 +229,4 @@ savedInstanceState不会null的时候,说明就是需要内存恢复的时候
222229
看到这里大家已经猜到其实这个框架的实现原理和BufferKnife是相同的。而bufferknife的原理很多文章都有,这里就不过多介绍了。
223230

224231
github地址:[https://github.com/JavaNoober/AutoSave](https://github.com/JavaNoober/AutoSave)
225-
226-
引入方式,在app的gradle中加入下面依赖即可:
227-
228-
229-
compile 'com.noober:savehelper:1.0.0'
230-
compile 'com.noober:savehelper-api:1.0.0'
231-
annotationProcessor 'com.noober:processor:1.0.0'
232-
232+

0 commit comments

Comments
 (0)