Code example for InvalidParameterException

    	public static final String BUNDLE_TITLE = "title";
    	public static final String BUNDLE_BODY = "body";
    	public static ConfirmationDialogFragment newInstance(String title, String body, DialogCallback dialogCallback) {
        	if (title == null || body == null) {
        		throw new InvalidParameterException("Title and body cannot be null");
            ConfirmationDialogFragment dialog = new ConfirmationDialogFragment();
            Bundle args = new Bundle();
            args.putString(BUNDLE_TITLE, title);
            args.putString(BUNDLE_BODY, body);
            callback = dialogCallback;
            return dialog;
        public Dialog onCreateDialog(Bundle savedInstanceState) {
        	AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
Contextual code suggestions in your IDE  Get Codota for Java