Back to project page android-gps-test-tool.
The source code is released under:
Apache License ? 2.0 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by...
If you think the Android project android-gps-test-tool 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 com.agup.gps.fragments; /* w w w . j ava2s . c om*/ import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.provider.Settings; public class NetworkAlertDialogFragment extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState){ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage("Internet is not currently enabled. Click ok to proceed to Settings.") .setTitle("Toggle Wireless Settings"); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent settingsIntent = new Intent(Settings.ACTION_WIRELESS_SETTINGS); getActivity().startActivity(settingsIntent); } }); builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { NetworkAlertDialogFragment.this.getDialog().cancel(); } }); AlertDialog dialog = builder.create(); return dialog; } }