This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of TensorFlow 2.0 in Action and have Thushan Ganegedara on-line!
See this thread for details.
Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Basic Question on Value passed from Intent

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

     I'm new to Java and Android. Just started. I'm going through Head First Android book. In the 3rd chapter, it discussed on starting another activity from launch activity and through Intent. In the launch activity for the button action onClick method, below is the code:


In the other Activity, ReceiveMessageActivity the message from launch activity, typed in edittext is displayed.



My question is EXTRA_MESSAGE is constant and static. How can the value is replaced by another text? Sorry if my question way too noob. But I'm noob!  
 
Rancher
Posts: 497
7
Android Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it did not replaced by another text.

EXTRA_MESSAGE is a key, you are storing messageText  in this Intent object using EXTRA_MESSAGE key.

In ReceiveMessageActivity, you are calling the EXTRA_MESSAGE key to get the messageText.  

The key you using for both activity is same.
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic