Skip to content

Instantly share code, notes, and snippets.

@shikto1
Last active December 23, 2020 04:53
Show Gist options
  • Save shikto1/21e4fa6be89628562ca990bcc90151d5 to your computer and use it in GitHub Desktop.
Save shikto1/21e4fa6be89628562ca990bcc90151d5 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
private var smsReceiver: SMSReceiver? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Init Sms Retriever >>>>
initSmsListener()
}
private fun initSmsListener() {
val client = SmsRetriever.getClient(this)
client.startSmsRetriever()
}
override fun onDestroy() {
super.onDestroy()
smsReceiver = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment