1

Hello I got two Strings and a TextView:

TextView test = (TextView) findViewById(R.id.eins);
String one = "DynamicText";
String two = "Title";
test.setText(two+one);

Now I would to set the two Strings in one TextView but I like to formate the String two text align to center and the String one normal (left). How is this possible?

Marco D.
  • 133
  • 2
  • 17

1 Answers1

0
TextView txtOne = (TextView) findViewById(R.id.txtOne );
TextView txtTwo = (TextView) findViewById(R.id.txtOne);
textOne.setText("DynamicText");
txtTwo.setText("Title");
txtTwo.setGravity(Gravity.CENTER);
Christian
  • 25,249
  • 40
  • 134
  • 225
Rohit B.
  • 5
  • 5