Created
September 21, 2022 11:15
-
-
Save mikkipastel/172fa4d6a3e55e559e58717c42165a84 to your computer and use it in GitHub Desktop.
start second activity by intent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ascedncorp.androidbasic | |
import android.content.Intent | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
import com.ascedncorp.androidbasic.databinding.ActivityMainBinding | |
class MainActivity: AppCompatActivity() { | |
private val binding: ActivityMainBinding by lazy { | |
ActivityMainBinding.inflate(layoutInflater) | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(binding.root) | |
binding.button.setOnClickListener { | |
val intent = Intent(this, SecondActivity::class.java) | |
startActivity(intent) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment