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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:14:22+00:00 2026-05-23T16:14:22+00:00

My application has a main activity A, and a secondary one, B (called on

  • 0

My application has a main activity “A”, and a secondary one, “B” (called on a button click).
Just before activity B is started, from activity A I run an async task to get xml data from a remote web service.
How do I then pass xml data to activity B? I can’t use something like

intent.putExtra("xmlData", xmlData);

since, when intent is started, xmlData is empty, yet…

Or, am I using a wrong approach? I decided to run the async task from activity A, instead than B, since I suppose I can save some time waiting for remote data in activity B…

  • 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-23T16:14:22+00:00Added an answer on May 23, 2026 at 4:14 pm

    Send the url, or unique data such as id if the url is the same, to the Activity B from A through intent.putExtra(), and fetch the data with AsyncTask as you onCreate the B activity. A progressDialog in onPreExecute might be in place as well.

    Then you can reuse the Activity B if there is any similar task e.g. fetch, parse and present.

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

Sidebar

Related Questions

In my application has two Activities. One is main activity and other is activity
My application starts from an Main activity and this main activity has its own
My current application has one Activity, the main one which extends ListActivity (listview of
I have 3 activity in my application. My first activity (Main) has 2 button
I have an application that has two threads. The first one (the main thread)
My main application does this: It retrievs data from the internet and has 3
I have an application that contains a main Activity, which has a very simple
In my application I start a Register activity from the Main Activity with a
I have two activities, one is main and I have another activity called Test
My application has a main form activity-1 with some <EditTexts> and a spinner, based

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.