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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:12:17+00:00 2026-06-05T13:12:17+00:00

I have a simple doubt. In android it been said almost everywhere that to

  • 0

I have a simple doubt. In android it been said almost everywhere that to pass a String or int or anything u supposed to use Intent and use putextra() or whatever to pass it over that next activity where as i can create a static object and access it from any activity

There has to be some reason behind using the intent to do so, can anyone please clear me why we need intent to pass an object from one activity to other where we can do it as normally as we do it in java.

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

    Because we don’t think of Activities in a static context. Activities have life cycles, so we try to incorporate our data within this life cycle rather than circumventing it.

    There’s nothing directly wrong with just using a static variable, but there could arise some problems. Say, for instance, you display multiple instances of an Activity. The String you need for the child Activity might be different than what you previously needed, so when navigating backwards to a previous instance of that Activity, the value is not what you were expecting.

    Passing the String in through the Intent also makes the Activity independent. One Activity should not be designed in a way that it is tightly coupled with another. Passing data through the Intent means that any Activity can start this Activity as long as it passes in the correct data.

    That said, there are cases where using a statically accessible variable are reasonable, such as for constants values that won’t change and are accessed by multiple parts of your app, or for any data that multiple Activities might need.

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

Sidebar

Related Questions

I have simple win service, that executes few tasks periodically. How should I pass
I have a simple doubt: I have an external assembly that I want to
i have a simple doubt in android programming. I am not familiar with java
I am new to android development. I have a doubt that while creating an
I have simple php validation form that is halfway working. If you leave the
please help me with a simple PHP doubt. I have a simple form: <
I have been learning about TDD (using JUnit) and I have a doubt about
I have a doubt in android ImageView . I'm making a sample application to
I have a very basic doubt here. I have two very simple C codes
This is no doubt a very simple question, but unfortunately I have looked around

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.