SaveState
SaveState copied to clipboard
:icecream: Generate 'onSaveInstanceState' and 'onRestoreInstanceState' methods for your application automatically
classpath "io.github.prototypez:save-state:0.2.3" Example: ```kt class MainActivity : AppCompatActivity() { @AutoRestore private var someInt: Long = 0L override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) if (savedInstanceState == null) someInt = System.currentTimeMillis()...
我的项目是 Java 语言,minSdkVersion 为 24 ,Android Studio 版本 4.0.1。 引入 SaveState 0.2.3 版本后,build 不通过,提示要求 minSdkVersion 不低于 26;移除 SaveState 后 build 通过。 但我好像没有在文档中找到关于 minSdkVersion 的限制。这是怎么回事呢? 编译时的错误信息: ``` Error: Invoke-customs are only...
报错是:.../app/build/intermediates/transforms/saveState/id/debug/29/play-services-location.properties (No such file or directory) 感觉是和已有的框架冲突了 请帮忙看一下,非常感谢 编译的报错是: Parsing class file /Users/gegeding/AndroidProjects/shopeemitra/app/build/intermediates/transforms/FirebasePerformancePlugin/id/debug/21/com/shopee/react/debug/ReactDebugAdapter.class fail. java.io.IOException: invalid constant type: 16 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090) at javassist.bytecode.ConstPool.read(ConstPool.java:1033) at javassist.bytecode.ConstPool.(ConstPool.java:149) at javassist.bytecode.ClassFile.read(ClassFile.java:737) at javassist.bytecode.ClassFile.(ClassFile.java:108) at...
编译时间超级长
项目开启了Instance Run,但是每次编译的时候时间长达4分钟,分析之后,看到其中有一项占用的时间超过4分钟。 :app:transformClassesWithSaveStateForProDebug | Running for 4 m 33 s
看源码,好像不支持 androidx 下的 fragment
onRestoreInstanceState 的调用是在 onStart 之后的,但是很多场景下,我们只会在 onCreate 中去发起网络请求,而网络请求需要这些保存的数据,所以提个建议希望可以在 onCreate 中恢复状态