Example usage for android.provider Settings ACTION_WIRELESS_SETTINGS

List of usage examples for android.provider Settings ACTION_WIRELESS_SETTINGS

Introduction

In this page you can find the example usage for android.provider Settings ACTION_WIRELESS_SETTINGS.

Prototype

String ACTION_WIRELESS_SETTINGS

To view the source code for android.provider Settings ACTION_WIRELESS_SETTINGS.

Click Source Link

Document

Activity Action: Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.

Usage

From source file:com.ranglerz.tlc.tlc.com.ranglerz.tlc.tlc.TLCDocument.PartnershipApplicant.java

protected void createNetErrorDialog() {

    if (isNetworkAvailable() == false) {

        android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(
                this);
        builder.setMessage(//from w  ww . ja va 2  s  . c o  m
                "You need a network connection to use this application. Please turn on mobile network or Wi-Fi in Settings.")
                .setTitle("Unable to connect").setCancelable(false)
                .setPositiveButton("Settings", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                        startActivity(i);
                    }
                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        PartnershipApplicant.this.finish();
                    }
                });
        android.support.v7.app.AlertDialog alert = builder.create();
        alert.show();
    } else {
        //remainging
    }
}

From source file:com.entertailion.android.dial.ServerFinder.java

private AlertDialog buildNoWifiDialog() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    builder.setMessage(R.string.finder_wifi_not_available);
    builder.setCancelable(false);//from w  w w . jav  a2 s.com
    builder.setPositiveButton(R.string.finder_configure, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialogInterface, int id) {
            Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
            startActivityForResult(intent, CODE_WIFI_SETTINGS);
        }
    });
    builder.setNegativeButton(R.string.finder_cancel, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialogInterface, int id) {
            setResult(RESULT_CANCELED, null);
            finish();
        }
    });
    return builder.create();
}

From source file:com.ranglerz.tlc.tlc.com.ranglerz.tlc.tlc.Insurance.ReportAccident.java

protected void createNetErrorDialog() {

    if (isNetworkAvailable() == false) {

        android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(
                this);
        builder.setMessage(//  w w  w.j  av  a  2  s .  c o m
                "You need a network connection to use this application. Please turn on mobile network or Wi-Fi in Settings.")
                .setTitle("Unable to connect").setCancelable(false)
                .setPositiveButton("Settings", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                        startActivity(i);
                    }
                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        ReportAccident.this.finish();
                    }
                });
        android.support.v7.app.AlertDialog alert = builder.create();
        alert.show();
    } else {
        //remainging
    }
}

From source file:com.ranglerz.tlc.tlc.com.ranglerz.tlc.tlc.Insurance.AddDriver.java

protected void createNetErrorDialog() {

    if (isNetworkAvailable() == false) {

        android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(
                this);
        builder.setMessage(/*from w w w . ja v  a 2 s. c o  m*/
                "You need a network connection to use this application. Please turn on mobile network or Wi-Fi in Settings.")
                .setTitle("Unable to connect").setCancelable(false)
                .setPositiveButton("Settings", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                        startActivity(i);
                    }
                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        AddDriver.this.finish();
                    }
                });
        android.support.v7.app.AlertDialog alert = builder.create();
        alert.show();
    } else {
        //remainging
    }
}

From source file:com.ranglerz.tlc.tlc.com.ranglerz.tlc.tlc.Summons.NewSummon.java

protected void createNetErrorDialog() {

    if (isNetworkAvailable() == false) {

        android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(
                this);
        builder.setMessage(/*from w w w  .j  a  v  a  2 s . co  m*/
                "You need a network connection to use this application. Please turn on mobile network or Wi-Fi in Settings.")
                .setTitle("Unable to connect").setCancelable(false)
                .setPositiveButton("Settings", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                        startActivity(i);
                    }
                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        NewSummon.this.finish();
                    }
                });
        android.support.v7.app.AlertDialog alert = builder.create();
        alert.show();
    } else {
        //remainging
    }
}

From source file:com.ranglerz.tlc.tlc.com.ranglerz.tlc.tlc.Insurance.TlcInsurance.java

protected void createNetErrorDialog() {

    if (isNetworkAvailable() == false) {

        android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(
                this);
        builder.setMessage(//w w  w  .j a  v  a 2s . com
                "You need a network connection to use this application. Please turn on mobile network or Wi-Fi in Settings.")
                .setTitle("Unable to connect").setCancelable(false)
                .setPositiveButton("Settings", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                        startActivity(i);
                    }
                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        TlcInsurance.this.finish();
                    }
                });
        android.support.v7.app.AlertDialog alert = builder.create();
        alert.show();
    } else {
        //remainging
    }
}