txca / managestartactivity Goto Github PK
View Code? Open in Web Editor NEWActivityResultLauncher辅助类,一行代码解决startActivityForResult过时问题。 基于registerForActivityResult实现,满足日常使用需求。
License: MIT License
ActivityResultLauncher辅助类,一行代码解决startActivityForResult过时问题。 基于registerForActivityResult实现,满足日常使用需求。
License: MIT License
按照楼主提供的继承方式使用,发现在使用starforResout时,Itent携带的数据丢失。而使用案例跳转没出现。不清楚啥情况。怎么排查呢
Caused by: java.lang.IllegalStateException: You can consumeRestoredStateForKey only after super.onCreate of corresponding component
由于之前的版本 (<1.0.3),系统配置变更(如屏幕旋转)后重建Activity时会导致回调被清空
所以在 >=1.0.4 后使用SavedStateRegistry
来监听保存配置变更时Activity已注册的回. 所以从1.0.4
开始,必须在super.onCreate()
后初始化 initMangeStartActivity
. 这里仍然推荐您紧随super.onCreate()
后立即调用initMangeStartActivity
,例如
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initManageStartActivity()
}
...
若升级前 (<=1.0.3) 版本的ManageStartActivity在super.onCreate()
后调用initManageStartActivity
, 本次升级(非兼容老版本升级)将不会对您造成任何影响
关联commits 18ae0c8
有时候跳转页面想要定制一下转场动画之类的,目前只用了ActivityResultLauncher.launch(I input),
希望加上ActivityResultLauncher.launch(I input, ActivityOptionsCompat options)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.