-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
In my task, i want to start maps me app with passing router parameter, but app is opening with last selection route type.
In my observations, i look what it's happen when i not pass lat_from anf lng_from parameters to android intent.
If my intent has lat_from anf lng_from parameters app has react to router paramter and open it with nedded route type.
private const val PACKAGE = "com.mapswithme.maps.pro"
private val INTENT = Intent(ACTION)
.setPackage(PACKAGE)
private const val VEHICLE = "vehicle"
private const val PEDESTRIAN = "pedestrian"
private const val PUBLIC_TRANSPORT = "transit"
override fun intent(lat: Double, lng: Double, deliveryMethodType: RouteType): Intent {
val mode = when(deliveryMethodType) {
WALK -> PEDESTRIAN
TRANSIT -> PUBLIC_TRANSPORT
AUTO -> VEHICLE
}
return INTENT.apply {
putExtra(LAT_TO, lat)
putExtra(LNG_TO, lng)
putExtra("router", mode);
}
}```
This is my code to build intent for starActivity method
Metadata
Metadata
Assignees
Labels
No labels