@@ -0,0 +1,1645 @@
+package com.otter.otterbenchmark;%0A%0Aimport android.app.AlertDialog;%0Aimport android.app.Dialog;%0Aimport android.app.DialogFragment;%0Aimport android.content.DialogInterface;%0Aimport android.os.Bundle;%0A%0Apublic class ErrorDialog extends DialogFragment %7B%0A    private static final String TAG = ErrorDialog.class.getSimpleName();%0A%0A    public static final String FRAGMENT_TAG = %22error_dialog%22;%0A%0A    private static final String BUNDLE_MESSAGE = %22message%22;%0A%0A    private String mMessage;%0A%0A    public static ErrorDialog newInstance(String message) %7B%0A        ErrorDialog fragment = new ErrorDialog();%0A%0A        Bundle args = new Bundle();%0A        args.putString(BUNDLE_MESSAGE, message);%0A        fragment.setArguments(args);%0A%0A        return fragment;%0A    %7D%0A%0A    public ErrorDialog() %7B%0A        // Required empty public constructor%0A    %7D%0A%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        if (getArguments() != null) %7B%0A            mMessage = getArguments().getString(BUNDLE_MESSAGE);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public Dialog onCreateDialog(Bundle savedInstanceState) %7B%0A        setCancelable(false);%0A%0A        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());%0A        builder.setTitle(R.string.error)%0A                .setMessage(mMessage)%0A                .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() %7B%0A                    @Override%0A                    public void onClick(DialogInterface dialog, int which) %7B%0A                        getActivity().finish();%0A                    %7D%0A                %7D);%0A%0A        return builder.create();%0A    %7D%0A%7D%0A

Add ErrorDialog class to show dialog and close activity