Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MapActivity:
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.weather_map_layout);
- mapView = (MapView) findViewById(R.id.myMapView);
- Bundle extras = getIntent().getExtras();
- float lat = extras.getFloat("latitude");
- float longi = extras.getFloat("longitude");
- ....
- ListActivity:
- ....
- protected void onListItemClick(ListView l, View v, final int position, long id) {
- super.onListItemClick(l, v, position, id);
- Intent newIntent = new Intent(ListarLocaisActivity.this, MapaActivity.class);
- Place coordenadas=listAdapter.getItem(position);
- double lat = coordenadas.getLatitude();
- double longi = coordenadas.getLongitude();
- newIntent.putExtra("latitude", lat);
- newIntent.putExtra("longitude",longi);
- startActivity(newIntent);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement