- 博客(1)
- 资源 (1)
- 收藏
- 关注
原创 Activity和Fragment的生命周期和使用注意
Activity和Fragment是安卓开发中用的最多的两个组件,所以我们需要对它们的生命周期有一个很清晰的认识。目前很多工作好多年的开发对一些细节不是很清楚,经常会导致一些bug的产生,在下面我会对生命周期做一些详细的介绍和一些开发中的常见注意事项。 下面用一张图简要的介绍下各生命周期: 从上面这张图我们可以知道Fragment的生命周期遵循着Activity,Acti...
2018-03-28 21:08:24 294
kotlin英文教程
Getting Started
Package specification should be at the top of the source file:
package my.demo
import java.util.*
// ...
It is not required to match directories and packages: source files can be placed arbitrarily in the file system.
See Packages.
Function having two Int parameters with Int return type:
fun sum(a: Int, b: Int): Int {
return a + b
}
Function with an expression body and inferred return type:
fun sum(a: Int, b: Int) = a + b
Function returning no meaningful value:
fun printSum(a: Int, b: Int): Unit {
print(a + b)
}
Unit return type can be omitted:
fun printSum(a: Int, b: Int) {
print(a + b)
}
See Functions.
Assign-once
2018-10-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人