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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:35:58+00:00 2026-05-16T15:35:58+00:00

So I have a MapActivity that runs an asynchtask that occasionally updates what exactly

  • 0

So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it’s displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode=”singletask” in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I’m not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity.

I hope that made sense. I can post code if necessary, but I think that should explain my situation.

  • 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-16T15:35:59+00:00Added an answer on May 16, 2026 at 3:35 pm

    When your activity flagged as singleTask is already running and a new Intent is sent to it, onNewIntent will be called to tell you about it.

    By default, this new Intent does not get stored in any way after that call returns, and the default implementation does nothing. If you override onNewIntent, you can process the extras attached to the new intent directly from there and/or use setIntent to attach the new intent to your Activity so that future getIntent().get*Extra(...) calls will return the updated data.

    Note that there is one special case: if your singleTask activity has launched another activity in its task (i.e. an embeddable activity without the NEW_TASK flag), that activity will come to the foreground when your activity receives an intent, but the intent itself will then be silently dropped. Be careful about that. See the Dev Guide for more info.

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

Sidebar

Related Questions

I have written one MapActivity class that is able to display a set of
I have an activity MyActivity that extends from MapActivity. In the .xml file containing
Sharing an Options Menu between Activity and MapActivity. Is this possible? I have an
I have a public class FriendMaps extends MapActivity that gets called from a menu
I'm trying to make something like this: I have a mapactivity and when the
I have an android app that extends a MapActivity, so I can't extend TabActivity.
I have a an app that starts with a MapActivity showing some POI's on
I have this method that get's the street names for Ambassy's out of a
I have a function that shows a map page so I can get the
I have an activity which extends MapActivity. After running the activity, the Google Map

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.