I have an Alert Dialog that is supposed to set a boolean to true. For setPositiveButton I have the Dialog onclick interface as null. When I add an onClickListener to the setNegativeButtons onclick interface it gives me a compile error saying: The method setNegativeButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments (String, new View.OnClickListener(){})
Here is my code, why am I getting a compile error and how do I fix this? Thanks
new AlertDialog.Builder(ImTracking.this)
.setMessage(
Html.fromHtml(getText("http://www.cellphonesolutions.net/im-following-"
+ getResources().getString(
R.string.Country))))
.setPositiveButton("OK", null)
// The red squigly is under the .setNegativeButton
.setNegativeButton("Don't Remind", new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
SharedPreferences prefs= getSharedPreferences("Settings",0);
SharedPreferences.Editor editor=prefs.edit();
editor.putBoolean("ImTrackingDontRemind",true);
editor.commit();
}
}).show();