views:

20

answers:

1

Hello, I create a tabbed view with a list and a map, this is the code used to build the tab:

tabHost = getTabHost();

TabSpec tabSpec = tabHost.newTabSpec("tab_map");
Intent i = new Intent().setClass(this, MyMapActivity.class);
tabSpec.setIndicator("Map",
 getResources().getDrawable(android.R.drawable.ic_menu_mapmode))
 .setContent(i);
tabHost.addTab(tabSpec);

now I need to access the MapView to set some Overlay on that map but if I try to do this:

MapView mapView = (MapView) findViewById(R.id.myMap);

the reference is always null, which is the right way? Thanks!!!

-- Luca

A: 

you could use

intent.putExtra(MyMapActivity.Something, value);

depends upon where you call MapView as whether the view has been inflated yet or not..obviously if it has not been inflated yet you might get a null

Fred Grott