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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:48:01+00:00 2026-06-14T18:48:01+00:00

Im having some doubts with this code. public class MainActivity extends Activity { public

  • 0

Im having some doubts with this code.

public class MainActivity extends Activity { 
    public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE"; 
    Intent intent = new Intent(this, DisplayMessageActivity.class); 
    EditText editText = (EditText) findViewById(R.id.edit_message); 
    String message = editText.getText().toString(); 
    intent.putExtra(EXTRA_MESSAGE, message); 
  1. Why we are using casting in EditText
  2. What is putExtra(EXTRA_MESSAGE,message) and its use??
  3. Why is MY_MESSAGE assigned to com.example.myfirstapp.MESSAGE? and What is com.example.myfirstapp.MESSAGE?
  • 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-14T18:48:02+00:00Added an answer on June 14, 2026 at 6:48 pm

    1) Because findViewById() is a generic method which returns a View

    2) An intent is a flexible way for decoupled communication, it’s like a message that you send (specifying a desired action and optional extra data). putExtra() is a method that allows you to embed information into your intent

    3) Intent’s extra data is based on a key-value storage. EXTRA_MESSAGE is the key where your message is stored. The receiver of your intent knows that it can retrieve your message from this key.

    4) “com.example.myfirstapp.MESSAGE” is the actual value of this key. It’s an arbitrary value which has to be known by the sender of the intent and its receiver so that they communicate through the intent

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

Sidebar

Related Questions

I am in process to create a Database connection class but having some doubts
having some doubts with LINQ queries over objects... I have this filter descriptions which
I'm having some problems with the following code: private class ClientPluginLoader : MarshalByRefObject {
I'm having some trouble with this statement, owing no doubt to my ignorance of
I'm having some doubts about how to upload something to a WebService. I've been
In the code base I was maintaining I found this exact class, pasted below.
After another question about iterators I'm having some doubts about custom containers. In my
I'm having some trouble in declaring a STL Set of pointers to class instances.
I don't usually design databases, so I'm having some doubts about how to normalize
I am a newbie to Python, i am having some doubts on working of

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.