wood burning stoves 2.0*
The moose likes Android and the fly likes Code from developer.android.com Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Code from developer.android.com" Watch "Code from developer.android.com" New topic
Author

Code from developer.android.com

kiruthigha rajan
Ranch Hand

Joined: Dec 29, 2011
Posts: 69
Hai im newbie to Android..
Im having some doubts in 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?
thanks in advance
 
Consider Paul's rocket mass heater.
 
subject: Code from developer.android.com
 
Similar Threads
nullpointer when i try to initiate onclicklistener
Starting a new activity from current
How to retrieve string from EditText?
String Length Finding Problem
Is there a way to add Text-to-speech to a call?