File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- [ ![ license] ( https://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat )] ( https://github.com/didi/VirtualAPK/blob/master/LICENSE )
1+ [ ![ license] ( https://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat )] ( https://github.com/JavaNoober/AutoSave )
22[ ![ JCenter] ( https://img.shields.io/badge/JCenter-AutoSaver-green.svg?style=flat )] ( https://bintray.com/noober/maven/AutoSaver )
33
44
1414 方法,现在就不会自动生成这个类的SaveStateHelper类,减少了无用SaveStateHelper类,便于在Base类中统一集成。
1515
1616
17+ 引入方式,在app的gradle中加入下面依赖即可:
18+
19+
20+ compile 'com.noober:savehelper:1.0.2'
21+ compile 'com.noober:savehelper-api:1.0.2'
22+ annotationProcessor 'com.noober:processor:1.0.2'
23+
1724# 引入
1825
1926android 内存被回收是一个开发者的常见问题。当我们** 跳转到一个二级界面,或者切换到后台** 的时候,如果时间过长或者手机的** 内存不足** ,当我们再返回这个界面的时候,activity或fragment就会被内存回收。这时候虽然界面被重新执行了onCreate,但是很多变量的值却已经被置空,这样就导致了很多潜在的bug,已经很多空指针的问题。
@@ -224,11 +231,4 @@ savedInstanceState不会null的时候,说明就是需要内存恢复的时候
224231看到这里大家已经猜到其实这个框架的实现原理和BufferKnife是相同的。而bufferknife的原理很多文章都有,这里就不过多介绍了。
225232
226233github地址:[ https://github.com/JavaNoober/AutoSave ] ( https://github.com/JavaNoober/AutoSave )
227-
228- 引入方式,在app的gradle中加入下面依赖即可:
229-
230-
231- compile 'com.noober:savehelper:1.0.0'
232- compile 'com.noober:savehelper-api:1.0.0'
233- annotationProcessor 'com.noober:processor:1.0.0'
234-
234+
You can’t perform that action at this time.
0 commit comments