diff --git a/samples/kotlin-android-app/src/main/java/com/amplitude/android/sample/MainActivity.kt b/samples/kotlin-android-app/src/main/java/com/amplitude/android/sample/MainActivity.kt index b828576e..ae370cd5 100644 --- a/samples/kotlin-android-app/src/main/java/com/amplitude/android/sample/MainActivity.kt +++ b/samples/kotlin-android-app/src/main/java/com/amplitude/android/sample/MainActivity.kt @@ -1,6 +1,7 @@ package com.amplitude.android.sample import android.os.Bundle +import android.widget.Button import androidx.appcompat.app.AppCompatActivity import com.amplitude.core.events.EventOptions import com.amplitude.core.events.Identify @@ -14,6 +15,8 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + val sendEventButton: Button = findViewById(R.id.button) + // set user properties val identify = Identify() identify.set("user-platform", "android") @@ -41,6 +44,8 @@ class MainActivity : AppCompatActivity() { amplitude.revenue(revenue) // track event with event properties - amplitude.track("test event properties", mapOf("test" to "test event property value"), options) + sendEventButton.setOnClickListener { + amplitude.track("test event properties", mapOf("test" to "test event property value"), options) + } } } diff --git a/samples/kotlin-android-app/src/main/res/layout/activity_main.xml b/samples/kotlin-android-app/src/main/res/layout/activity_main.xml index 109b1ab9..e5f37ee6 100644 --- a/samples/kotlin-android-app/src/main/res/layout/activity_main.xml +++ b/samples/kotlin-android-app/src/main/res/layout/activity_main.xml @@ -7,6 +7,7 @@ tools:context=".MainActivity"> +