GithubHelp home page GithubHelp logo

txca / managestartactivity Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 3.0 3.27 MB

ActivityResultLauncher辅助类,一行代码解决startActivityForResult过时问题。 基于registerForActivityResult实现,满足日常使用需求。

License: MIT License

Kotlin 100.00%

managestartactivity's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

managestartactivity's Issues

Itent携带的数据丢失

按照楼主提供的继承方式使用,发现在使用starforResout时,Itent携带的数据丢失。而使用案例跳转没出现。不清楚啥情况。怎么排查呢

[1.0.4] 破坏性升级说明 - IllegalStateException

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

建议startActivityForResult增加options参数

有时候跳转页面想要定制一下转场动画之类的,目前只用了ActivityResultLauncher.launch(I input),
希望加上ActivityResultLauncher.launch(I input, ActivityOptionsCompat options)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.