samedi 23 juillet 2016

Can findViewById(android.R.id.content) ever return null for Snackbars?

I want to be able to display Snackbars but I am confused by this notion that I have to supply it with a View. You'd think it'd allow you to display the Snackbar at the bottom of the screen by default, but maybe I am missing something.

Anyway supposedly this can be done by using the view:

findViewById(android.R.id.content)

However I get a warning that this may be null even though it always seems to work wherever I try it. When can it possibly be null?

Aucun commentaire:

Enregistrer un commentaire