Back to project page barcodescanner.
The source code is released under:
Apache License
If you think the Android project barcodescanner listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.dm7.barcodescanner.zxing.sample; //w ww .j a v a 2s . c o m import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app.DialogFragment; public class MessageDialogFragment extends DialogFragment { public interface MessageDialogListener { public void onDialogPositiveClick(DialogFragment dialog); } private String mTitle; private String mMessage; private MessageDialogListener mListener; public void onCreate(Bundle state) { super.onCreate(state); setRetainInstance(true); } public static MessageDialogFragment newInstance(String title, String message, MessageDialogListener listener) { MessageDialogFragment fragment = new MessageDialogFragment(); fragment.mTitle = title; fragment.mMessage = message; fragment.mListener = listener; return fragment; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(mMessage) .setTitle(mTitle); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { if(mListener != null) { mListener.onDialogPositiveClick(MessageDialogFragment.this); } } }); return builder.create(); } }