Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shoyu666/onsaveinstancestateeasy
onSaveInstanceStateEasy
https://github.com/shoyu666/onsaveinstancestateeasy
Last synced: 25 days ago
JSON representation
onSaveInstanceStateEasy
- Host: GitHub
- URL: https://github.com/shoyu666/onsaveinstancestateeasy
- Owner: shoyu666
- Created: 2016-11-09T12:20:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-10T03:38:57.000Z (almost 8 years ago)
- Last Synced: 2023-11-08T08:57:27.721Z (almost 1 year ago)
- Language: Groovy
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# onSaveInstanceStateEasy
### 特性
```
简化
onSaveInstanceState(Bundle outState)
```### 使用
```
public class MainActivity extends AppCompatActivity {
@SaveStatesAnno("key") //要保存的数据添加SaveStatesAnno key是保存数据到Bundle用的key
String dataToStore;
}上面代码等价于
public class MainActivity extends AppCompatActivity {
String dataToStore;
public void onSaveInstanceState(Bundle var1) {
var1.putSerializable("key",dataToStore);
super.onSaveInstanceState(var1);
}
}
``````
Todo1:目前只支持Serializable类型,支持更多
2:添加读取操作
```