public void sendMessage(View view) {
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);
startActivity(intent);
}
in line
EditText editText = (EditText) findViewById(R.id.edit_message);
EditTextis a class and
EditTextis an instance that we create.
findViewById(R.id.edit_message)is the method, and R.id.edit_messageis the argument that we pass
But I canβt understand why there is such a (EditText)gift? Is this a constructor call?
source
share