Last active
December 23, 2020 04:53
-
-
Save shikto1/21e4fa6be89628562ca990bcc90151d5 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
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