Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4609196
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:57:09+00:00 2026-05-22T00:57:09+00:00

I have a method that creates popups on tap, called onBalloonTap and i am

  • 0

I have a method that creates popups on tap, called onBalloonTap and i am trying to call CallPopup() in another class pip. What am I doing wrong? Should I not be calling intent via method? My goal is to launch another activity when onBalloonTap is called. Is there a better way to do this?

CallPopUp() in pip

public void CallPopup()
{   Log.i("CallPopup", "Started CallPopup");
    startActivity(intent);
    finish();
}

being called from onBalloonTap in another class

protected boolean onBalloonTap(int index, OverlayItem item) {
    Toast.makeText(c, "onBalloonTap for overlay index " + index,
            Toast.LENGTH_LONG).show();
    pip pipinst =new pip();
    pipinst.CallPopup();
    return true;
}

I get this log:

05-04 22:33:41.022: ERROR/AndroidRuntime(704): FATAL EXCEPTION: main
05-04 22:33:41.022: ERROR/AndroidRuntime(704): java.lang.NullPointerException
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.app.Activity.startActivityForResult(Activity.java:2817)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.app.Activity.startActivity(Activity.java:2923)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.appname.pip.pip.CallPopup(pip.java:192)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.appname.pip.MyItemizedOverlay.onBalloonTap(MyItemizedOverlay.java:67)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay$1.onTouch(BalloonItemizedOverlay.java:203)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.View.dispatchTouchEvent(View.java:3762)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.os.Looper.loop(Looper.java:123)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at java.lang.reflect.Method.invokeNative(Native Method)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at java.lang.reflect.Method.invoke(Method.java:521)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-04 22:33:41.022: ERROR/AndroidRuntime(704):     at dalvik.system.NativeStart.main(Native Method)
05-04 22:33:41.102: WARN/ActivityManager(38):   Force finishing activity com.appname.pip/.pip
05-04 22:33:41.952: WARN/ActivityManager(38): Activity pause timeout for HistoryRecord{43f680f0 com.appname.pip/.pip}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:57:10+00:00Added an answer on May 22, 2026 at 12:57 am

    It looks like the “pip” class extends Activity, but you are just creating a pip object without going through any of the Activity lifecycle. The null pointer exception is probably because your pip object has no idea what its parent Context is. You almost certainly have access to a Context object in onBalloonTap (e.g., View.getContext()), so why not just call Context.startActivity() from there?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that creates a local textfield and pops up the keyboard
I have a method that contains the following (Java) code: doSomeThings(); doSomeOtherThings(); doSomeThings() creates
I have a method CreateAccount(...) that I want to unit test. Basically it creates
I have a unit test that creates a mock calls my method to be
I have created a gem that adds a new method to the class ActiveRecord::Base.
Currently I have created a ABCFactory class that has a single method creating ABC
I have a method that creates a series in a chart and plots 1
I have a Method that makes a phone call. The number and delay comes
I have created a method that should ideally take a single Account object and
Hi I want to create a WCF service that have login method, which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.