Code example for AlertDialog.Builder

Methods: setSingleChoiceItems

0
		{ 
			throw new IllegalStateException("SnoozePreference requires an entries array.");
		} 
		mSnoozeTime = mSettings.getSnoozeTime();
		int index = Math.min(Math.max(mSnoozeTime / 5, 0), entries.length - 1);
		builder.setSingleChoiceItems(entries, index, new DialogInterface.OnClickListener()
		{ 
			public void onClick(DialogInterface dialog, int which)
			{ 
				if (which == 0)
					mSnoozeTime = 0;
				else 
					mSnoozeTime = which * 5;
			} 
		}); 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java