Reputation: 1247
None of the following functions can be called with the arguments supplied.
make(View, CharSequence, Int)
defined in android.support.design.widget.Snackbar
make(View, Int, Int)
defined in android.support.design.widget.Snackbar
fun showError(Str_Msg: String) {
toolbar!!.visibility = View.VISIBLE
if (fragment != null) fragment!!.dismiss()
mActivity!!.window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
snackbar = Snackbar.make(cl_main, Str_Msg, Snackbar.LENGTH_SHORT)
.setAction(getString(R.string.lbl_retry)) { }
snackbar!!.show()
}
Upvotes: 2
Views: 2812
Reputation: 1247
cl_main
is nullable
and make(View, CharSequence, Int)
requires cl_main
to be non-nullable
.
Quickfix: make(cl_main!!, Str_Msg ...)
Thanks for @Pete
Upvotes: 3