Last active
April 28, 2019 08:44
-
-
Save RafalManka/1e9a277a6f847fc847bfca4b8fe33ba3 to your computer and use it in GitHub Desktop.
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.example.user | |
import android.app.Activity | |
import android.content.Intent | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.view.View | |
import android.widget.EditText | |
class SelectUserActivity : AppCompatActivity() { | |
private val editText: EditText by lazy { findViewById<EditText>(R.id.editText) } | |
private val confirm: View? by lazy { findViewById<View>(R.id.confirm) } | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_details) | |
confirm?.setOnClickListener { | |
val data = Intent().apply { putExtra("contact", editText.text.toString()) } | |
setResult(Activity.RESULT_OK, data) | |
finish() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment