android studio textview in center 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);