I'm a begineer in android. I learned from the developer.android.com, how to display a text by calling another activity. I want to display the user entered text in the same window. i.e., slow the text field(center). please anyone help me. I'm a beginner in android and I have just started to learn android.
mainactivity.java file
public void displayMessage(View view){
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
// Set the text view as the activity layout
setContentView(message);
}
Main Activity.java file. What functionalities should i add to the displayMessage method?
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">SimpleApp</string>
<string name="edit_message">Enter Something</string>
<string name="button_send">Send</string>
<string name="action_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>