I was wondering if there was a way to display all text in a toast to be centered. For instance, I have a toast that has 2 lines of text in it. For purely aesthetic reasons,
Toast is built on a TextView and the default gravity of it is left aligned. So, you need to create your own TextView like this for instance :
And you assign the TextView to the Toast like this :
Toast t = new Toast(yourContext); t.setView(yourNewTextView);