Example usage for android.support.v4.app DialogFragment getText

List of usage examples for android.support.v4.app DialogFragment getText

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment getText.

Prototype

public final CharSequence getText(@StringRes int resId) 

Source Link

Document

Return a localized, styled CharSequence from the application's package's default string table.

Usage

From source file:org.andstatus.app.util.DialogFactory.java

public static Dialog newYesCancelDialog(final DialogFragment dialogFragment, String title, String message) {
    Dialog dlg;/*from  www. j av  a 2s.  c om*/
    AlertDialog.Builder builder = new AlertDialog.Builder(dialogFragment.getActivity());
    builder.setTitle(title).setMessage(message).setPositiveButton(dialogFragment.getText(android.R.string.yes),
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    dialogFragment.getTargetFragment().onActivityResult(dialogFragment.getTargetRequestCode(),
                            Activity.RESULT_OK, null);
                }
            }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    dialogFragment.getTargetFragment().onActivityResult(dialogFragment.getTargetRequestCode(),
                            Activity.RESULT_CANCELED, null);
                }
            });
    dlg = builder.create();
    return dlg;
}