Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.app.AlertDialog;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;

public class Main {
    public static void ShowNetworkSettings(final Context ctx) {
        new AlertDialog.Builder(ctx).setTitle("Nessuna connessione ad internet")
                .setMessage("Vuoi aprire le impostazioni di rete?")
                .setPositiveButton("SI", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        // continue
                        ctx.getApplicationContext()
                                .startActivity(new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS));
                    }
                }).setNegativeButton("NO", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        // do nothing
                    }
                }).show();
    }
}