When I select a city from my 3rd tab, I want to it to show up in the “Map” tab. For example, when I first select “Austin” as the city, it shows up on the map (as shown in the picture bellow). But when I go back to the “City” tab again and choose a different city, it doesn’t get updated in the “Map” tab. Can you please tell me if there is a way I can refresh the “MapsActicity” each time I click on the “Map” tab.
public class HelloTabWidget extends TabActivity implements OnTabChangeListener {`
private TabHost mtabHost;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
mtabHost = getTabHost();
mtabHost.setOnTabChangedListener(this);
intent = new Intent().setClass(this, BarActivity.class);
spec = tabHost.newTabSpec("Name").setIndicator("Name",res.getDrawable(R.drawable.ic_tab_bar)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, MapsActivity.class);
spec = tabHost.newTabSpec("Map").setIndicator("Map",res.getDrawable(R.drawable.ic_tab_map)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, CityActivity.class);
spec = tabHost.newTabSpec("city").setIndicator("City", res.getDrawable(R.drawable.ic_tab_city)).setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(2);
}
public void onTabChanged(String tabId) {
int a = mtabHost.getCurrentTab();
String b = Integer.toString(a);
if(b.equals("1"))
{
Toast.makeText(getApplicationContext(), "Map Selected", Toast.LENGTH_LONG).show();
}
}
}

Update:
`public class MapsActivity extends MapActivity
{
MapView mapView;
MapController mc;
GeoPoint p;`
class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts);
Bitmap bmp = BitmapFactory.decodeResource(
getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
return true;
}
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main4);
mapView = (MapView) findViewById(R.id.mapView);
LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);
View zoomView = mapView.getZoomControls();
zoomLayout.addView(zoomView,
new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
mapView.displayZoomControls(true);
String []coordinates = new String[4];
coordinates[0] = "33.477863"; coordinates[1] = "-101.855166"; //Just in-case user didn't choose a city
if(CityActivity.value.equals("Austin")) { //This 'value' is recived from CityActivity. Depending on what city user chooses.
coordinates[0] = "30.260053"; coordinates[1] = "-97.738593"; }
else if(CityActivity.value.equals("Dallas")) {
coordinates[0] = "33.554519"; coordinates[1] = "-101.855621"; }
else if(CityActivity.value.equals("Slaton")) {
coordinates[0] = "33.577863"; coordinates[1] = "-101.855166"; }
double lat = Double.parseDouble(coordinates[0]);
double lng = Double.parseDouble(coordinates[1]);
p = new GeoPoint(
(int) (lat * 1E6),
(int) (lng * 1E6));
mc = mapView.getController();
mc.animateTo(p);
mc.setZoom(16);
mapView.invalidate();
MapOverlay mapOverlay = new MapOverlay();
List<Overlay> listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
mapView.invalidate();
}
@Override
protected boolean isRouteDisplayed() {
return false;
} }
Try to move this peace of code in OnResume() Method