Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I launch settings directly on Wireless & networks page?

Tags:

android

I am about to build my own dialog to notifiy the user the app doesn't reach the internet, and I am planning to put two buttons on it. Settings, and Cancel as it is seen in many other apps.

I am wondering now, How do I launch settings directly on Wireless & networks page?

like image 465
Pentium10 Avatar asked May 12 '10 10:05

Pentium10


People also ask

How do I enable wireless settings?

Go to the Start Menu and select Control Panel. Click the Network and Internet category and then select Networking and Sharing Center. From the options on the left-hand side, select Change adapter settings. Right-click on the icon for Wireless Connection and click enable.

What is the shortcut to turn on wireless capability?

Enable WiFi with a function key Another way to enable WiFi is by pressing the "Fn" key and one of the function keys (F1-F12) at the same time to toggle wireless on and off. The specific key to use will vary by computer. Look for a small wireless icon as shown in the below example image of an F12 key.


1 Answers

/**
     * Display a dialog that user has no internet connection
     * @param ctx1
     *
     * Code from: http://osdir.com/ml/Android-Developers/2009-11/msg05044.html
     */
    public static void showNoConnectionDialog(Context ctx1) {
        final Context ctx = ctx1;
        AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
        builder.setCancelable(true);
        builder.setMessage(R.string.no_connection);
        builder.setTitle(R.string.no_connection_title);
        builder.setPositiveButton(R.string.settings, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                ctx.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
            }
        });
        builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                return;
            }
        });
        builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
            public void onCancel(DialogInterface dialog) {
                return;
            }
        });

        builder.show();
    }
like image 172
Pentium10 Avatar answered Sep 19 '22 12:09

Pentium10