Reputation: 3202
I make a splash screen without any content view (just with logo image as theme background), which shown till app initialization done.
If an error occurs during initialization I'd like to notify user by snackbar. Is there a way to show snackbar without inflating content view?
I tried to pass getWindow().getDecorView()
as view
argument to Snackbar.make()
, but nothing happened.
Upvotes: 3
Views: 2938
Reputation: 1142
You should be passing getWindow().getDecorView().getRootView()
:
Snackbar.make(getWindow().getDecorView().getRootView(), "Some error occured", Snackbar.LENGTH_LONG).show();
Upvotes: 6