If you are using Dialog , then:
dialog_share = new Dialog(MainScreen.this, R.style.DialogTheme); dialog_share.requestWindowFeature(Window.FEATURE_NO_TITLE); LayoutInflater inflater = this.getLayoutInflater(); mDialogView = inflater.inflate(R.layout.dialog_share, null); dialog_share.setContentView(mDialogView); dialog_share.getWindow().setBackgroundDrawableResource(R.color.translucent_black); dialog_share.show(); public void ShowSnackBarNoInternetOverDialog() { Snackbar snackbar = Snackbar.make(mDialogView, getString(R.string.checkinternet), Snackbar.LENGTH_LONG); snackbar.setActionTextColor(Color.CYAN); snackbar.setAction("OK", new View.OnClickListener() { @Override public void onClick(View v) {
source share