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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:19:30+00:00 2026-06-01T13:19:30+00:00

My work flow is as follows: LoginActivity -> ActivityB -> ActivityC -> ActivityD I’d

  • 0

My work flow is as follows:

LoginActivity -> ActivityB -> ActivityC -> ActivityD

I’d like to pass data from LoginActivity to ActivityD, but not go directly to ActivityD. ie, I’d like to pass data from LoginActivity to ActivityD, but go to ActivityB and ActivityC before I get to ActivityD and get the data there.

Is this possible?

I know to pass data from one activity to another the code is as follows:

        Intent i = new Intent(getApplicationContext(), AnotherActivity.class); 
        i.putExtra("key", (int)1); 
        i.putExtra("something", something); 
        startActivity(i);

And in AnotherActivity you do the following to get the data:

        Bundle extras = getIntent().getExtras();   
        if(extras !=null) 
        {  
            String var = extras.getString("something");
        }

But this does not work if I want to delay going straight to the activity. So if I take out startActivity(i); and go to another activity. The program crashes when tyring get the data in the final activity. The good old NullPointerExeption pops up.

Does anyone know a way of doing what I’ve described? Get the data from one activity to another, but not go (or start) that activity right away?

  • 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-01T13:19:31+00:00Added an answer on June 1, 2026 at 1:19 pm

    If you want to pass the data like this, it is preferable to use shared preferences.
    It is simple to use and you can use the data any where in your program.

    SharedPreferences.Editor editor = prefs.edit();
    editor.putString("key", (int)1);
    editor.putString("something", something);
    editor.commit(); 
    

    at the time of receiving:

    SharedPreferences prefs = getSharedPreferences(prefName, MODE_PRIVATE); 
    String something = prefs.getString("something", null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a stored procedure to delete data from multiple tables. my work
I'm creating a pipe that basically needs to follow the work flow as follows:
I am trying to follow a similar work flow as others using Backbone and
I made work flow in sugar Pro. When a task is done notification email
I am working in Liferay Portal. I have created my custom work flow and
I have spring 2.5 application and several pages in the flow work perfectly -
My flow is as follows: the user clicks sign in on site 1. a
I am trying to understand the ins and outs of how references work, but
I am attempting to pass information from a task created within a workflow to
I have two view controllers. The flow between them is as follows: VC1 creates

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.