Add kotlin example for LocationUpdatesPendingIntent/#141
Add kotlin example for LocationUpdatesPendingIntent/#141jQrgen wants to merge 6 commits intoandroid:mainfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
I signed it! |
|
|
||
| implementation 'com.android.support:design:26.1.0' | ||
| implementation 'com.google.android.gms:play-services-location:12.0.1' | ||
| implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
There was a problem hiding this comment.
It could be just "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
There was a problem hiding this comment.
You can create a buildSrc module with Kotlin code to manage dependencies and get IDE completion support which is a big win. You can follow this tutorial for reference.
| val action = intent.action | ||
| if (ACTION_PROCESS_UPDATES == action) { | ||
| val result = LocationResult.extractResult(intent) | ||
| if (result != null) { |
There was a problem hiding this comment.
As we are talking about Kotlin here, there can be a slight improvement.
result?.let {
// not null do something
//everything which is in your if body can come here
}
No description provided.