Jay
Jay

Reputation: 5084

Android Snackbar covering the control buttons in Google Pixel

The Snackbar covers the control buttons of the Google Pixel device. The device is running Nougat and the screenshot illustrates the issue:

enter image description here

This is happening due to the buttons being virtual. What changes are required to avoid this issue in devices where the control buttons are virtual?

Code:

Snackbar.make(MainActivity.this.getWindow().getDecorView(), getString(R.string.incorrect_details), Snackbar.LENGTH_LONG).show();

Upvotes: 1

Views: 685

Answers (1)

Martin De Simone
Martin De Simone

Reputation: 2148

Use as the first parameter android.R.id.content

 Snackbar.make(findViewById(android.R.id.content), getString(R.string.incorrect_details), Snackbar.LENGTH_LONG).show();

Upvotes: 4

Related Questions