java - explain the syntax EditText editText = (EditText) findViewById(R.id.edit_message); -


  / ** is when a user clicks on Send Button / Send Public Empty Message (View View) {Intent to intent = new intent (this, DisplayMessageActivity.class); Edittext EditingTextX (Find Text) VVBIID (RaidAdit_message); String message = editText.getText (). ToString (); Intent.putExtra (EXTRA_MESSAGE, message); StartActivity; }  

in the line

  Edit text editing tag = (edit text) Find VVBID (RID.edit_message);  

EditText class and editText is the example that we are making. findViewById (R.id.itit_message) is the method and rd.edit_message is the argument that we are passing

but I do not understand Coming So why is (Editing Text) present? Does this call the constructor?

This is a typical typewriting findViewById () see a and (EditText) clearly type it into a EditText (see of a subclass ). Since the object is actually returned, it works - a EditText , it is that if one of the objects in this class or one of its subclasses does not happen, then you will see the Class Cluster Exposure will be received.

Read more:


Comments