Splashscreen code using kotlin in android studio - Joklinz-Tech

Latest

Home Of Tech news,jobs and android tutorials

Thursday, 25 January 2018

Splashscreen code using kotlin in android studio



class MainActivity : AppCompatActivity() {

    private  val splash:Int=3000    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_main)
        val action=supportActionBar
        action?.setDisplayShowHomeEnabled(true)
        action?.setIcon(R.mipmap.ic_launcher)


        Handler().postDelayed({            val i= Intent(this,Main4Activity::class.java)
            startActivity(i)
            finish()
        },splash.toLong())

    }

No comments:

Post a Comment