Android代码-自动帮你完成 onSaveInstanceState 和 onRestoreInstanceState 的相关操作

时间:2022-08-26 02:37:24
【文件属性】:

文件名称:Android代码-自动帮你完成 onSaveInstanceState 和 onRestoreInstanceState 的相关操作

文件大小:269KB

文件格式:ZIP

更新时间:2022-08-26 02:37:24

Android代码

SaveState 中文文档 Automatically save and restore states of Activities, Fragments and Views. No boilerplate code like onSaveInstanceState or onRestoreInstanceState any more. Getting started Just add the @AutoRestore annotation to your fields that need to be saved and restored in Activities, Fragments and Views. In Activities: class MyActivity : Activity() { @AutoRestore var myInt: Int = 0; @AutoRestore var myRpcCall: IBinder? = null; @AutoRestore var result: String? =


网友评论