Back to project page socialcde4android.
The source code is released under:
MIT License
If you think the Android project socialcde4android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.uniba.socialcde4android.dialogs; //from w w w . j ava2 s.co m import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; import android.provider.Settings; public class NoNetworkDialog extends DialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the Builder class for convenient dialog construction AlertDialog.Builder builder=new AlertDialog.Builder(getActivity()); builder.setMessage("Internet Connection Required.."); builder.setCancelable(false); builder.setPositiveButton("Open Settings",new OnClickListener(){ public void onClick(DialogInterface dialog, int id){ //ACTION_WIRELESS_SETTINGS //ACTION_NETWORK_OPERATOR_SETTINGS Intent intent=new Intent(Settings.ACTION_SETTINGS); startActivity(intent); dialog.cancel(); } }) .setNegativeButton("Annulla", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); //builder.show(); // Create the AlertDialog object and return it return builder.create(); } }