how to set text from java to xml layout android code example
Example: android studio set text of textview
// globally
TextView myAwesomeTextView = (TextView)findViewById(R.id.myAwesomeTextView);
//in your OnCreate() method
myAwesomeTextView.setText("My Awesome Text");