I\'m using Google Maps API V2 in an activity wih drop down navigation where the map is on the second position.
I\'m adding the map pragmatically like:
In addition to Kirk's answer: since public void onAttach(Activity activity) is deprecated you can now simply use:
@Override
public void onAttach(Context context) {
super.onAttach(context);
Activity activity;
if (context instanceof Activity){
activity=(Activity) context;
try {
this.mListener = (OnCompleteListener)activity;
} catch (final ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement OnCompleteListener");
}
}
}
The rest remains the same... One might want to use (Fragment sender) as a parameter though and always pass this.