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 W3Make Forum 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 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.

Sign InSign Up

Forum By W3make

Forum By W3make Logo Forum By W3make Logo

Forum By W3make Navigation

  • Home
  • About Us
  • Blog
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Questions Feed
  • Blog
  • Contact Us
Home/ Questions/Q 3496
Next
In Process
saalyk
  • 0
saalyk
Asked: June 17, 20232023-06-17T21:19:05+05:30 2023-06-17T21:19:05+05:30In: Android Development

android development

  • 0

How to communicate between activities in Android?

androidandroid developmentquestion
  • 4 4 Answers
  • 38 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

4 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. amannayak774 Begginer
    2023-06-17T22:52:22+05:30Added an answer on June 17, 2023 at 10:52 pm

    if you want to interact with different activities then you can you Intent method for the

    this method has parameter as startActivity to desitination activity name

    i.e e.g – you want to move from activity 1 to activity 2

    you can use code as

    val intent = Intent(this,activity 2 :: class java )

    start(intent)

    here start method is called to start the intent activity

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. enigmatic_vansh
    2023-06-17T22:00:31+05:30Added an answer on June 17, 2023 at 10:00 pm
    This answer was edited.

    1.Using Intents:

    Start an activity by creating an Intent and passing data through Intent extras (using putExtra() methods). The launched activity can retrieve the data using getIntent() and get the extras.
    You can also use startActivityForResult() to start an activity and receive a result back from it.

    2.Using Bundles:

    Bundles are used to pass data between activities using the putExtras() method of an Intent. The receiving activity can retrieve the data using getIntent().getExtras().

    3.Using Parcelable or Serializable:

    Implement the Parcelable or Serializable interfaces in your custom class to make it serializable. Then you can put instances of the class directly in the Intent extras or Bundle to pass them between activities.

    4.Using a Shared ViewModel:

    Create a ViewModel instance and share it between multiple activities. The activities can observe changes in the ViewModel to communicate and share data.

    5.Using a Singleton or Application class:

    Create a Singleton class or extend the Application class to store and share data globally across activities.

    6.Using Local Broadcasts:

    Send broadcasts using the LocalBroadcastManager class and register BroadcastReceivers in activities to listen for and receive those broadcast

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  3. akshatt25 Teacher
    2023-06-17T22:25:17+05:30Added an answer on June 17, 2023 at 10:25 pm

    Using intents

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  4. bavna Begginer
    2023-06-18T13:25:30+05:30Added an answer on June 18, 2023 at 1:25 pm

    By using intent:

    1. create an intent object.
    2. add extras/data to it.
    3. start new activity using ‘startActivity(intent)’.
    4. retrieve the data from intent using ‘getIntent().getExtras()’.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 3k
  • Answers 2k
  • Best Answers 34
  • Users 5k
  • Popular
  • Answers
  • Mohammed aleem hasan

    What programming language is used for Android development?

    • 65 Answers
  • Manichandana

    Is this mandatory to write css code in making a ...

    • 58 Answers
  • vishakha_1713

    How to decide whether to use DELETE statement or DROP ...

    • 46 Answers
  • Jova0731
    Jova0731 added an answer If you're new to buying a custom sex doll, you… July 31, 2025 at 8:41 am
  • Jova0731
    Jova0731 added an answer Some of us with dark hearts want to design other… July 5, 2025 at 1:56 pm
  • Dewey
    Dewey added an answer In a world where loneliness is rising, torso sex dolls… April 22, 2025 at 6:44 am

Related Questions

  • jean8

    u4gm Diablo 4 Season 10 Rogue Build for Efficient Farming

    • 0 Answers
  • Anonymous

    The Art of Escalation: How to Survive and Thrive in ...

    • 0 Answers
  • Rozemondbell

    Mmoexp Call of Duty Black Ops 6 Bot Lobbies: What ...

    • 0 Answers

Top Members

saningh

saningh

  • 5 Questions
  • 116 Points
Pundit
Vishnu M

Vishnu M

  • 2 Questions
  • 96 Points
Teacher
akshatt25

akshatt25

  • 12 Questions
  • 68 Points
Teacher

Trending Tags

#css #html #questions 3d printing ai android android development android studio answer api app development c++ coding data Database developer development error flutter hacking help ios java javascript kotlin machine learning ml performance php plugin plugins poll programming python question security seo social media sql technology theme web web development website WordPress word press wordpress development wordpressdevelopment wordpress error wordpress errors

Explore

  • Recent Questions
  • Most Answered
  • Answers
  • Most Visited
  • Most Voted
  • No Answers
  • Feed
  • Favorites Questions

Footer

W3make forum is a social questions & Answers platform which will help you establis your community and connect with other people.

Legal Stuff

  • Privacy Policy
  • Terms and Conditions

Help

  • Questions Feed
  • Blog
  • Contact Us

Follow

© 2023 W3make.com | All Rights Reserved.

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.