Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Fixed Issue# 195 and other errors that were causing initial build issues after cloning repo #198

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ class MainActivity : AppCompatActivity() {
private fun getLastLocation() {
fusedLocationClient.lastLocation
.addOnCompleteListener(this) { task ->
if (task.isSuccessful && task.result != null) {
val mLastLocation = task.result
if (task.isSuccessful && mLastLocation != null) {
latitudeText.text = resources
.getString(R.string.latitude_label, task.result.latitude)
.getString(R.string.latitude_label, mLastLocation.latitude)
longitudeText.text = resources
.getString(R.string.longitude_label, task.result.longitude)
.getString(R.string.longitude_label, mLastLocation.longitude)
} else {
Log.w(TAG, "getLastLocation:exception", task.exception)
showSnackbar(R.string.no_location_detected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class MainActivity : AppCompatActivity() {
/**
* The formatted location address.
*/
private var addressOutput = ""
private var addressOutput : String? = ""

/**
* Receiver registered with this activity to get the response from FetchAddressIntentService.
Expand Down
4 changes: 2 additions & 2 deletions LocationUpdatesForegroundService/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 'android-Q'
compileSdkVersion 29

defaultConfig {
applicationId "com.google.android.gms.location.sample.locationupdatesforegroundservice"
minSdkVersion 16
targetSdkVersion 'Q'
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 2 additions & 2 deletions LocationUpdatesPendingIntent/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 'android-Q'
compileSdkVersion 29

defaultConfig {
applicationId "com.google.android.gms.location.sample.locationupdatespendingintent"
minSdkVersion 16
targetSdkVersion 'Q'
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down