Андрей Кирилин
Профи
(692)
7 месяцев назад
Set the location at which the notification should appear on the screen.
Warning: Starting from Android Build.VERSION_CODES.R, for apps targeting API level Build.VERSION_CODES.Or higher, this method is a no-op when called on text toasts.
public void buttonClicked(View view) {
Toast myToast = Toast.makeText(getApplicationContext(), "Сообщение",
Toast.LENGTH_LONG);
myToast.setGravity( Gravity.TOP ,0,0);
myToast.show();
}