I want to use Notification inside the try-catch block, located inside a click listener of a button.
But when I place the notification in catch block it show following error:
“The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined”
You did not give any code (why not? I mean, come on 🙂 ), but you are probably doing a call inside the listener with
this.You are expecting the
thisto be yourActivity, but instead it is theOnClickListeneryou are in. Hence the errror: there is no constructor that takes anOnClickListeneras an argument.