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
  • 1
  • 14

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
  • 23,801
  • 35
  • 124
  • 210
Rohit B.
  • 5
  • 5