Android Open Source - AndroidNetworkStatus Confirm Dialog






From Project

Back to project page AndroidNetworkStatus.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidNetworkStatus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.diolan.netstat;
/*from www .  ja v a2  s . co  m*/
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

/**
 * Created by d.barkalov on 13.08.2014.
 */
public class ConfirmDialog  extends DialogFragment {

    public static ConfirmDialog newInstance(int title) {
        ConfirmDialog frag = new ConfirmDialog();
        Bundle args = new Bundle();
        args.putInt("title", title);
        frag.setArguments(args);
        return frag;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        int title = getArguments().getInt("title");

        return new AlertDialog.Builder(getActivity())
                //.setIcon(R.drawable.alert_dialog_icon)
                .setTitle(title)
                .setPositiveButton(R.string.alert_dialog_ok,
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                                if (getTargetFragment() != null) {
                                    getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, null);
                                }
                            }
                        }
                )
                .setNegativeButton(R.string.alert_dialog_cancel,
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                                // empty
                            }
                        }
                )
                .create();
    }

}




Java Source Code List

com.diolan.netstat.ConfirmDialog.java
com.diolan.netstat.NetStatActivity.java
com.diolan.netstat.NetStatFragment.java
com.diolan.netstat.NetStatListAdapter.java
com.diolan.netstat.data.DataEntry.java
com.diolan.netstat.data.DatabaseService.java
com.diolan.netstat.data.NetStatContentProvider.java
com.diolan.netstat.data.NetworkChangesReceiver.java
com.diolan.netstat.data.StatDbHelper.java