@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case IDD_COLOR:
return new AlertDialog(this); // The constructor AlertDialog(context) is not visible
}
return null;
}
Why? What’s wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The constructor
AlertDialog(Context context)isprotected, and is only visible to its class, sub-classes and classes within the same package.See this link for how to create an
AlertDialog: