I have this scenario:
- Main activity with one button. Once clicked it launchs 'mapActivity'
- Map activity (extending MapActivity) uses an ItemizedOverlay (extending ItemizedOverlay) class to mark places over the map.
Now, I want to launch another activity from my itemized overlay. I achieved to launch one activity as standar intent this way:
@Override
public boolean onTap(GeoPoint point, MapView mapView) {
boolean tapped = super.onTap(point, mapView);
if (!tapped){
Intent intent = new Intent();
intent.setClass(this.context, EditarLugarActivity.class);
this.context.startActivity (intent);
return true;
}
EditarLugarActivity is an activity whichs obtain a text input from user. Now, I need to get that text from the Itemized Overlay activity. Context have the value from map activity context and is set in constructor in this way:
public MiItemizedOverlay(Context context, Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
this.context = context;
populate();
}
To do this I've tried to use 'sartActivityForResult' instead 'this.content.startActivity(intent) in this way:
@Override
public boolean onTap(GeoPoint point, MapView mapView) {
boolean tapped = super.onTap(point, mapView);
if (!tapped){
Intent intent = new Intent();
intent.setClass(this.context, EditarLugarActivity.class);
this.context.startActivityForResult (intent,1);
return true;
}
but is not recognized by the compiler. 'this.context' is not working as it work for a simple 'startActivity'
Someone can help me with this? Thanks!
EDIT- Adding my MiItemizedOverlay class first line with 'extends':
public class MiItemizedOverlay extends ItemizedOverlay<OverlayItem> {
private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
private Context context; [....]