Hi I have implemented a google map with projection points so when i click a point it opens up a balloon showing some information relating to it. I have used this [github](https://github.com/jgilfelt/android-mapviewballoons) resource which makes it quite easier (thanks to Paul Sasik for guidance). What i want is when i click on each baloon it should open up a new Activity, I have tried implementing that in its onTap method but the problem is that i cant startActivity in a class that is extended from a framelayout class. So here is my code :

```
public class CouponMapView extends MapActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
               ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable, mapView);
               //all the mapoverlay code goes here...........
               //this part works fine.

            }
    }

```

***//----Class ItemizedOverlay in which im calling startActivity-----***

```
public class ItemizedOverlay extends BalloonItemizedOverlay<OverlayItem> {
    private ArrayList<OverlayItem> overlays = new ArrayList<OverlayItem>();
    private Context context;
    private int id;

    public ItemizedOverlay(Drawable defaultMarker, MapView mapView) {
        super(boundCenter(defaultMarker), mapView);
        context = mapView.getContext();
    }

    public void addOverlay(OverlayItem overlay) {
        overlays.add(overlay);
        populate();
    }

    @Override
    protected OverlayItem createItem(int i) {
        return overlays.get(i);
    }

    @Override
    public int size() {
        return overlays.size();
    }

    @Override
    protected boolean onBalloonTap(int index) {
//---I cant call startActivity here as this class is not inhereted from Activity its //extended from a class that is extended from FrameLayout that you will find if you scroll down.
        SubActivity sub = new SubActivity();
        sub.startCustomActivity();
        return true;
    }
}

```

***//--To start a new activity and to call startActivity method i have to create a new class and extends it from Activity...***

```
public class SubActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    public void startCustomActivity(){
        Intent Details = new Intent(getBaseContext(), Tab.class);
        Details.putExtra("Id", 1327);
        startActivity(Details);
    }

}

```

**Output:**
cant paste image directly the link is this
[mapView show overlay details when clicked](https://stackoverflow.com/questions/4923422/mapview-show-overlay-details-when-clicked)

The image above is similar to what i am getting so when i click on the overlay this should startup a new intent activity where i want to show some details.

But when i click on it i get these errors. I am not sure if i am doing it the right way. I am calling the subActivity class when the image is clicked.

```
02-21 19:21:44.769: ERROR/AndroidRuntime(462): FATAL EXCEPTION: main
02-21 19:21:44.769: ERROR/AndroidRuntime(462): java.lang.NullPointerException
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.content.ComponentName.<init>(ComponentName.java:75)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.content.Intent.<init>(Intent.java:2678)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.SubActivity.startCustomActivity(SubActivity.java:17)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.ItemizedOverlay.onBalloonTap(ItemizedOverlay.java:52)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.BalloonItemizedOverlay$1.onTouch(BalloonItemizedOverlay.java:177)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.View.dispatchTouchEvent(View.java:3762)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)

```