Skip to content

Instantly share code, notes, and snippets.

@jetaggart
Created June 29, 2020 18:45
Show Gist options
  • Save jetaggart/4e6d812a1fa7c6a4f735a28a753a5f5d to your computer and use it in GitHub Desktop.
Save jetaggart/4e6d812a1fa7c6a4f735a28a753a5f5d to your computer and use it in GitHub Desktop.
// android/app/src/main/java/io/getstream/thestream/CreateChannelActivity.kt:13
const val CHANNEL_CREATE_SUCCESS = 99
class CreateChannelActivity : AppCompatActivity(), CoroutineScope by MainScope() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_create_channel)
val submit: Button = findViewById(R.id.submit)
val channelName: EditText = findViewById(R.id.channel_name)
submit.setOnClickListener {
launch(Dispatchers.IO) {
ChatService.createGroupChannel(
channelName.text.toString()
)
launch(Dispatchers.Main) {
setResult(CHANNEL_CREATE_SUCCESS)
finish()
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment