ich habe einen gewissen Spielraum und logtitute i diese MapActivity senden wollen, ist es möglich, dass ich viele Möglichkeiten, tat aber failledSenden von Daten an MapActivity
public void setdaata(View view){
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("key", "value");
Intent intent = new Intent(this, MapsActivity.class);
intent.putExtra("map", item);
startActivity(intent);
}
und Empfangen von Code in Mapacitivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
Intent intent = getIntent();
HashMap<String, String> hashMap = (HashMap<String, String>)intent.getSerializableExtra("map");
Log.v("HashMapTest", hashMap.get("key"));
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
Was ist das Problem? es funktioniert nicht? Hast du irgendeine Ausnahme? –
mögliche Duplikate von: http://StackOverflow.com/Questions/7578236/How-to-Send-Hashmap-Value-in-another-activity-using-an-intent – dex