public void onSelectDirections(View view) { String latAndLong = "google.navigation:q="; GPSLocation loc = db.getLotLocation(lot); latAndLong += loc.getLatitude() + "," + loc.getLongitude(); Uri uri = Uri.parse(latAndLong); Intent intent = new Intent(Intent.ACTION_VIEW, uri); intent.setData(Uri.parse(latAndLong)); Intent chooser = Intent.createChooser(intent, "Launch Maps"); startActivity(intent); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_parking); db = new ParkingDB(getBaseContext()); parkingText = (TextView) findViewById(R.id.parkingText); lotText = (TextView) findViewById(R.id.lotText); visitorText = (TextView) findViewById(R.id.visitorText); Intent intent = getIntent(); building = intent.getStringExtra("building"); pass = intent.getStringExtra("pass"); lot = db.findClosestLot(building, pass); setText(); }