I’m trying to send data from an overlay to other activity with this class
public class Capas extends ItemizedOverlay<OverlayItem>
{
MapView Map;
private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
@SuppressWarnings("unused")
private Context mContext;
public Capas(Drawable defaultMarker, Context context)
{
super(boundCenterBottom(defaultMarker));
mContext = context;
}
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
if (event.getAction() == 1) {
GeoPoint puntoTocado = mapView.getProjection().fromPixels((int) event.getX(),(int) event.getY());
Intent nuevoLugar=new Intent(Capas.this,editarLugar.class);
nuevoLugar.putExtra("latitud",puntoTocado.getLatitudeE6());
nuevoLugar.putExtra("longitud",puntoTocado.getLongitudeE6());
StartActivity()
}
return false;
}
}
But this return me the next error The constructor Intent(Capas, Class) is undefined.
I try with Intent nuevoLugar=new Intent(Capas.class,editarLugar.class); Intent nuevoLugar=new Intent(this,editarLugar.class); but anoone works
In this case this should work:
Provided that
editarLugar extends Activityand is declared inAndroidManifest.xml.And to start the activity: