Back to project page taxitwin-app.
The source code is released under:
GNU General Public License
If you think the Android project taxitwin-app 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 kimle.michal.android.taxitwin.dialog.alert; // w w w .j ava 2s . co m 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; import kimle.michal.android.taxitwin.R; import kimle.michal.android.taxitwin.application.TaxiTwinApplication; public class GPSAlertDialogFragment extends DialogFragment { public static final int GPS_REQUEST = 10000; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(R.string.gps_alert_message) .setTitle(R.string.gps_alert_title) .setPositiveButton(R.string.location_settings, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(intent, GPS_REQUEST); dismiss(); } }) .setNegativeButton(R.string.close, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { TaxiTwinApplication.exit(getActivity()); } }); return builder.create(); } @Override public void onCancel(DialogInterface dialog) { TaxiTwinApplication.exit(getActivity()); } }