正式採用の「Kotlin」で挑戦! 初めてのAndroidアプリ開発 〜ストップウォッチを作ってみよう〜 employment.en-japan.com の記事のメモ。
インポート
import android.os.Bundle import android.os.Handler import android.widget.Button; import android.widget.TextView;
レイアウト難しい。
メソッド違う?
Type inference failed%3A Not enough information to infer parameter T in fun <T %3A View!> findViewById(p0%3A Int)%3A T! Please specify it explicitly.
android - Error on findViewById after upgrading to compile sdk version - Stack Overflow
val timeText = findViewById<TextView>(R.id.timeText) val startButton = findViewById<Button>(R.id.start) val stopButton = findViewById<Button>(R.id.stop) val resetButton = findViewById<Button>(R.id.reset)
ジェネリックメソッドになった。