Created
April 28, 2019 08:39
-
-
Save RafalManka/358bce3b97fa43cf2515b83cb4fbd9d8 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.contact | |
import android.content.Intent | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.widget.Button | |
import android.widget.TextView | |
private const val requestCodeDetails = 22 | |
class ContactFormActivity : AppCompatActivity() { | |
private val navigation = ContactFormModule.navigation | |
private val textView: TextView by bind(R.id.textView) | |
private val button: Button by bind(R.id.button) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_overview) | |
button.setOnClickListener { | |
navigation.start( | |
senderActivity = this, | |
screenId = ContactFormModule.GoTo.selectUser, | |
requestCode = requestCodeDetails | |
) | |
} | |
} | |
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (requestCode == requestCodeDetails && data != null) { | |
textView.text = data.getStringExtra("contact") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment