how to set your text in center android studio code example
Example 1: android studio text alignment center
set the 'gravity' attribute center_horizontal and center_vertical
Example 2: android textview center align text programmatically
yourTextView.setGravity(Gravity.CENTER);