This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Code from developer.android.com
 
jQuery in Action, 3rd edition