package com.example.converter;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;

public class ConverterDialogFragment extends DialogFragment {
    private String title;
    private String text;

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {        
        Bundle arguments = getArguments();
        if (arguments != null) {
            title = arguments.getString("title");
            text = arguments.getString("text");
        }
        
        AlertDialog.Builder b = new AlertDialog.Builder(getActivity());        
        if (!title.equals("")) {
            b.setTitle(title);            
        }
        b.setMessage(text);
        b.setNeutralButton(android.R.string.ok, null);
        return b.create();
    }
}