dependencies {
compile "org.jetbrains.anko:anko-commons:$anko_version"
}
Useful Intent callers
Anko has call wrappers for some widely used Intents:
| Goal | Solution |
|---|---|
| Make a call | makeCall(number) without tel: |
| Send a text | sendSMS(number, [text]) without sms: |
| Browse the web | browse(url) |
| Share some text | share(text, [subject]) |
| Send a email | email(email, [subject], [text]) |
Example
val btn = findviewById(R.id.button) as Button
btn.setOnclicklistner{
makeCall("079504838383")
}
btn.setOnclicklistner{
sendSMS("079504838383")
}
btn.setOnclicklistner{
email("wise4rmgod@gmail.com")
}

No comments:
Post a Comment