https://youtu.be/g0ihjCAy3N8

To start a new activity in Kotlin, you need to create an Intent object and pass the current context and the target activity class as parameters. Here's a sample code:

// Define the intent
val intent = Intent(this@CurrentActivity, TargetActivity::class.java)

// Start the activity
startActivity(intent)

In the above example, replace CurrentActivity with the name of the current activity and TargetActivity with the name of the activity you want to start.

You can also pass data between activities using Intent extras. Here's an example:

https://youtu.be/iUTv7IREYhU

// Define the intent
val intent = Intent(this@CurrentActivity, TargetActivity::class.java)

// Add data to the intent
intent.putExtra("key", "value")

// Start the activity
startActivity(intent)

In the above example, replace key with the name of the data you want to pass and value with the actual value.

That's it! You now have a basic understanding of how to start an activity in Kotlin.

To pass large data between activities in Kotlin, you can use Parcelable or Serializable objects.

For example, let's say you have a custom object called CustomObject that implements Parcelable. Here's how you can pass it to another activity:

// Define the intent
val intent = Intent(this@CurrentActivity, TargetActivity::class.java)

// Create a new instance of CustomObject
val customObject = CustomObject()

// Add the object to the intent
intent.putExtra("custom_object", customObject)

// Start the activity
startActivity(intent)

In the above example, replace CustomObject with the name of your custom object class.

To retrieve the object in the target activity, use the following code:

// Retrieve the object from the intent
val customObject = intent.getParcelableExtra<CustomObject>("custom_object")

In the above example, replace CustomObject with the name of your custom object class.

That's it! You can now pass large data between activities in Kotlin using Parcelable or Serializable objects.

Here's an example of starting an activity with view binding in Kotlin:

// Define the binding variable
private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)

    // Define the intent
    val intent = Intent(this, TargetActivity::class.java)

    // Start the activity
    startActivity(intent)
}