my dog learned polymorphism*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code from developer.android.com