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 8035529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:20:27+00:00 2026-06-05T02:20:27+00:00

in my android application i am using a library , in this there is

  • 0

in my android application i am using a library , in this there is a non-activity class from where i want to intent, how can this be done

im using this library

https://github.com/galex/android-mapviewballoons

here is the snippet of my code where i want to intent, this function is being called in the library

    protected boolean onBalloonTap(int index, OverlayItem item) {
    Toast.makeText(c, "clicked pin is :  " + item.getTitle(),
            Toast.LENGTH_SHORT).show();



    Intent intent = new Intent(firstActivity.class,secondActivity.class);
    startActivity(intent);
    //there is no startActivity method here
    return true;
}

here is the logcat

06-05 18:06:19.350: D/dalvikvm(370): GC_EXTERNAL_ALLOC freed 72K, 49% free 2790K/5379K, external 2064K/2137K, paused 74ms
06-05 18:06:19.709: D/dalvikvm(370): GC_EXTERNAL_ALLOC freed 34K, 47% free 2885K/5379K, external 2300K/2686K, paused 50ms
06-05 18:06:20.240: D/dalvikvm(370): GC_EXTERNAL_ALLOC freed 6K, 47% free 2884K/5379K, external 3730K/4658K, paused 72ms
06-05 18:06:42.919: D/PhoneWindow(370): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@40538220 has no id.
06-05 18:06:44.569: D/dalvikvm(370): GC_EXTERNAL_ALLOC freed 54K, 46% free 3022K/5511K, external 5867K/6444K, paused 47ms
06-05 18:06:47.969: D/dalvikvm(370): GC_CONCURRENT freed 831K, 49% free 3472K/6727K, external 7393K/8076K, paused 5ms+7ms
06-05 18:06:48.829: I/MapActivity(370): Handling network change notification:CONNECTED
06-05 18:06:48.829: E/MapActivity(370): Couldn't get connection factory client
06-05 18:06:49.220: D/dalvikvm(370): GC_CONCURRENT freed 1748K, 53% free 3827K/8007K, external 7777K/8076K, paused 6ms+7ms
06-05 18:06:51.919: D/AndroidRuntime(370): Shutting down VM
06-05 18:06:51.919: W/dalvikvm(370): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-05 18:06:51.949: E/AndroidRuntime(370): FATAL EXCEPTION: main
06-05 18:06:51.949: E/AndroidRuntime(370): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.app.ContextImpl.startActivity(ContextImpl.java:624)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.content.ContextWrapper.startActivity(ContextWrapper.java:258)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.project.ennis.Maps.SimpleItemizedOverlay.onBalloonTap(SimpleItemizedOverlay.java:80)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay$2.onTouch(BalloonItemizedOverlay.java:231)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.View.dispatchTouchEvent(View.java:3881)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.os.Looper.loop(Looper.java:130)
06-05 18:06:51.949: E/AndroidRuntime(370):  at android.app.ActivityThread.main(ActivityThread.java:3683)
06-05 18:06:51.949: E/AndroidRuntime(370):  at java.lang.reflect.Method.invokeNative(Native Method)
06-05 18:06:51.949: E/AndroidRuntime(370):  at java.lang.reflect.Method.invoke(Method.java:507)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-05 18:06:51.949: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-05 18:06:51.949: E/AndroidRuntime(370):  at dalvik.system.NativeStart.main(Native Method)
06-05 18:06:53.749: I/Process(370): Sending signal. PID: 370 SIG: 9
06-05 18:06:55.140: D/dalvikvm(383): GC_EXTERNAL_ALLOC freed 55K, 49% free 2762K/5379K, external 2102K/2137K, paused 80ms
  • 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-06-05T02:20:28+00:00Added an answer on June 5, 2026 at 2:20 am

    use I think you have context there in that class…..

     Intent intent = new Intent(c,secondActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//it you are already adding other
     c.startActivity(intent); 
    

    which is getting used in

    Toast.makeText(c, “clicked pin is : ” + item.getTitle(),
    Toast.LENGTH_SHORT).show();

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

Sidebar

Related Questions

I'm using this library project in my Android application. But I need to make
I want to add a non-native shared library to Android so every application on
I'm writing an android application using eclipse. I have a main activity called MenuActivity
I am writing a android application using sqlite . There are many activities and
I am using the following library to stream YouTube videos to an Android application.
I`m trying to build a application using the Fragment/Tabs and Pager from the android
I'm using the Simple XML library to process XML files in my Android application.
Has anyone migrated a an application using Java AWT library to run on Android?
I want to use com.google.android.maps.MapView, but can't figure out how to download the library
I'm using android-cmake to compile an application for Android. This essentially creates a CMake

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.