Comments (3)
package androidx.core.os
public fun bundleOf(vararg pairs: kotlin.Pair<kotlin.String, kotlin.Any?>): android.os.Bundle
关于Fragment,不是有现成的bundleOf方法吗?
from ktkit.
with(Intent(context, targetClass)) { params().forEach { makeParams(it) } this }
就简单两个问题:
- forEach装箱拆箱问题
- 不用with,用apply不是更好?最后返回就不用写this
感谢你的反馈
forEach 确实存在 装箱拆箱问题,还会生成临时对象,会跟着下次的版本一起修复
确实 apply 比 with 会更好些
from ktkit.
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)
- 关于扩展方法的注解和内联 HOT 3
- ./gradlew spotlessApply 命令运行不了 HOT 2
- 关于view的操作的bug HOT 2
- CharSequence和String的问题 HOT 2
- View.clickTrigger的BUG HOT 1
- 跟DataStore有冲突 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktkit.