GithubHelp home page GithubHelp logo

startActivity about ktkit HOT 3 OPEN

aowoWolf avatar aowoWolf commented on August 26, 2024
startActivity

from ktkit.

Comments (3)

aowoWolf avatar aowoWolf commented on August 26, 2024
package androidx.core.os

public fun bundleOf(vararg pairs: kotlin.Pair<kotlin.String, kotlin.Any?>): android.os.Bundle

关于Fragment,不是有现成的bundleOf方法吗?

from ktkit.

hi-dhl avatar hi-dhl commented on August 26, 2024

with(Intent(context, targetClass)) { params().forEach { makeParams(it) } this }
就简单两个问题:

  1. forEach装箱拆箱问题
  2. 不用with,用apply不是更好?最后返回就不用写this

感谢你的反馈

forEach 确实存在 装箱拆箱问题,还会生成临时对象,会跟着下次的版本一起修复
确实 apply 比 with 会更好些

from ktkit.

hi-dhl avatar hi-dhl commented on August 26, 2024
package androidx.core.os

public fun bundleOf(vararg pairs: kotlin.Pair<kotlin.String, kotlin.Any?>): android.os.Bundle

关于Fragment,不是有现成的bundleOf方法吗?

从写法上少一点步骤,例如 bundleOf

val bunlde = bundleOf(
    KEY_USER_NAME to "ByteCode",
    KEY_USER_PASSWORD to "1024",
    KEY_PEOPLE_PARCELIZE to PeopleModel("hi-dhl")
)
LoginFragment().arguments = bunlde

from ktkit.

Related Issues (7)

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.