Skip to content

Instantly share code, notes, and snippets.

@RafalManka
Last active April 28, 2019 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RafalManka/1e9a277a6f847fc847bfca4b8fe33ba3 to your computer and use it in GitHub Desktop.
Save RafalManka/1e9a277a6f847fc847bfca4b8fe33ba3 to your computer and use it in GitHub Desktop.
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