Quantcast
Viewing all articles
Browse latest Browse all 14

Answer by Rymnel for How to change position of Toast in Android?

If you get an error indicating that you must call makeText, the following code will fix it:

Toast toast= Toast.makeText(getApplicationContext(), 
"Your string here", Toast.LENGTH_SHORT);  
toast.setGravity(Gravity.TOP|Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();

Viewing all articles
Browse latest Browse all 14

Trending Articles