To install the text in the TextView:
1) find the TextView
2) set the text by id
Java
TextView myElement = this.findViewById(R.id.my_element1);
if (myElement!=null)
myElement.setText("My name is Evgen. Thank you!");
All code:
Java
File MainActivity.java
package com.example.androidapp1;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// set text
TextView myElement = this.findViewById(R.id.my_element1);
if (myElement!=null)
myElement.setText("My name is Evgen. Thank you!");
}
}