- SDカードイメージを指定してAVDを作成
パス指定 - android create avd -n <AVD名> -t 2 -c <SDイメージファイルパス>
サイズ指定 - android create avd -n <AVD名> -t 2 -c 512M
- エミュレータ起動
emulator -avd <AVD名> - エミュレータに接続
関数名 | 渡し方 | 参照 | 戻り値 | 例(val str = "hoge") |
---|---|---|---|---|
apply | 関数 | this | this | val strApply = str?.apply{ println( toUpperCase()) } |
run | 関数 | this | 結果の値 | val upperStr = str?.run{ toUppserCase() } |
let | 関数 | it | 結果の値 | val upperStr = str?.let{ it.toUppserCase() } |
also | 関数 | it | this | val strAlso = str?.also{ println( it.toUpperCase()) } |
with | 引数 | this | 結果の値 | val upperStr = with(str){ toUpperCase() } |
vararg にひとつだけのパラメータを渡す場合、次のように書くと 1.2 から警告が出力されるようになる。 (1.3 からはコンパイルエラーになる??)
val s = "abc,def"
println( s.split(delimiters = ','))
warning: assigning single elements to varargs in named form is deprecated
What's New in Kotlin 1.2: Deprecation: single named argument for vararg
OlderNewer