Add button for testing Google Maps
This commit is contained in:
@@ -2,9 +2,11 @@ package com.example.busroute
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.location.Location
|
||||
import android.location.LocationManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Looper
|
||||
import android.preference.PreferenceManager
|
||||
@@ -74,6 +76,14 @@ class MainActivity : ComponentActivity() {
|
||||
map.overlays.add(marker)
|
||||
map.invalidate()
|
||||
}
|
||||
val mapsButton = findViewById<Button>(R.id.maps)
|
||||
mapsButton.setOnClickListener{
|
||||
val mapIntentUri =
|
||||
Uri.parse("google.navigation:q=Moutier,+France&waypoints=Cevins%7CAigueblanche")
|
||||
val mapIntent = Intent(Intent.ACTION_VIEW, mapIntentUri)
|
||||
mapIntent.setPackage("com.google.android.apps.maps")
|
||||
startActivity(mapIntent)
|
||||
}
|
||||
|
||||
val rotationGestureOverlay = RotationGestureOverlay(map)
|
||||
rotationGestureOverlay.isEnabled
|
||||
|
||||
Reference in New Issue
Block a user