I need to have an AlertDialog appear when a certain button on a PopupWindow is clicked. In order to call AlertDialog.Builder() I need a context. If I try using “this” then I get an error “Type mismatch: cannot convert from new View.OnClickListener(){} to Context“. There are several other kinds of context I know of like getBaseContext() but when I try those instead the program crashes. I’m not sure which type I should use, and am worried whether fundamentally the OS is trying to tell me that having an alertdialog within a pupupwindow is a no-no.
I need to have an AlertDialog appear when a certain button on a PopupWindow
Share
Pass in the parent activity as the context Mick. That will be the appropriate context for the dialog.