While using Nougat's new multi-window mode, I noticed that a
toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);
I suspect this is the intended behaviour. Beyond there not being any straightforward way to achieve what you desire, according to the Material Design Guidelines Toasts are used primarily to convey system messages and should appear at the bottom of the screen.
My guess would be that any system messages should pertain to the device as a whole, and are not necessarily application specific, so this consistent behaviour makes sense. That said, I can see why this behaviour is undesirable, because the Toast ends up taking up practically 25% of the screen on one of the applications... however, regardless of the position of the Toast it will be gobbling up that screen real estate, whether it's on your application or the one below.
If you really wanted to implement a workaround, here is the implementation for offsetting the Toast vertically. A slight variation should achieve landscape mode, but it's a bit more finnicky.
View root = findViewById(R.id.root_main); int xy = new int; root.getLocationOnScreen(xy); DisplayMetrics displayMetrics = new DisplayMetrics(); WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); wm.getDefaultDisplay().getMetrics(displayMetrics); int devHeight = displayMetrics.heightPixels; int viewHeight = root.getHeight(); Toast toast = Toast.makeText(getApplicationContext(), "hello", Toast.LENGTH_LONG); int yOffset = Math.abs(xy - devHeight + viewHeight) + toast.getYOffset(); toast.setGravity(Gravity.BOTTOM, 0, yOffset); toast.show();