123456789101112131415161718192021222324252627282930313233343536373839 |
- package com.epson.memcardacc;
- import android.app.AlertDialog;
- import android.app.Dialog;
- import android.content.DialogInterface;
- import android.os.Bundle;
- import android.support.p000v4.app.DialogFragment;
- public class MemcardTempAlertDialogFragment extends DialogFragment {
- private static final String KEY_MESSAGE = "message";
- public interface DialogCallback {
- void onPositiveCallback();
- }
- public static MemcardTempAlertDialogFragment newInstance(String str) {
- MemcardTempAlertDialogFragment memcardTempAlertDialogFragment = new MemcardTempAlertDialogFragment();
- Bundle bundle = new Bundle();
- bundle.putString("message", str);
- memcardTempAlertDialogFragment.setArguments(bundle);
- return memcardTempAlertDialogFragment;
- }
- public Dialog onCreateDialog(Bundle bundle) {
- String string = getArguments().getString("message");
- if (string == null) {
- string = "";
- }
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- builder.setMessage(string).setPositiveButton(getActivity().getString(R.string.str_ok), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- }
- });
- AlertDialog create = builder.create();
- create.setCanceledOnTouchOutside(false);
- return create;
- }
- }
|