如何在处理程序中将java转换为kotlin

时间:2017-06-10 11:23:11

标签: java android xml kotlin

如何在处理程序

中将java转换为kotlin
new Handler().postDelayed(new Runnable(){
    @Override
    public void run() {
        /* Create an Intent that will start the Menu-Activity. */
        Intent mainIntent = new Intent(Splash.this,Menu.class);
        Splash.this.startActivity(mainIntent);
        Splash.this.finish();
    }
}, 3000);

1 个答案:

答案 0 :(得分:24)

Handler().postDelayed({
    /* Create an Intent that will start the Menu-Activity. */
    val mainIntent = Intent(this, Menu::class.java)
    startActivity(mainIntent)
    finish()
}, 3000)