Reputation: 533
I'm developing the application-messenger and need to show dynamically "No Connection" message in case of lack of Internet, like in popular messengers (Viber, etc).
It should look like the narrow strip below the Action Bar or below the tabs. What is the best way to add such view dynamically? Is it custom SnackBar or PopupWindow?
Upvotes: 1
Views: 1019
Reputation: 80944
You can use this:
compile 'com.androidadvance:topsnackbar:1.1.1'
then in the code add this example:
TSnackbar.make(findViewById(android.R.id.content),"no internet connection",TSnackbar.LENGTH_LONG).show();
This is the library for the above, it adds snackbars under toolbars:
https://github.com/AndreiD/TSnackBar
Upvotes: 3