Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code from developer.android.com

 
kiruthigha rajan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic