Created
September 4, 2019 20:40
-
-
Save mayowa-egbewunmi/830f21b91bdfe54404955711ee9fbe4a 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 LocationActivity : AppCompatActivity() { | |
private lateinit var locationViewModel: LocationViewModel | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_location) | |
locationViewModel = ViewModelProviders.of(this).get(LocationViewModel::class.java) | |
} | |
private fun startLocationUpdate() { | |
locationViewModel.getLocationData().observe(this, Observer { | |
latLong.text = getString(R.string.latLong, it.longitude, it.latitude) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment