Created
June 29, 2020 18:45
-
-
Save jetaggart/4e6d812a1fa7c6a4f735a28a753a5f5d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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