document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.      * Function to check if best network provider
  3.      * @return boolean
  4.      * */
  5.     public boolean canGetLocation() {
  6.         return this.canGetLocation;
  7.     }
  8.      
  9.     /**
  10.      * Function to show settings alert dialog
  11.      * */
  12.     public void showSettingsAlert(){
  13.         AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
  14.      
  15.         // Setting Dialog Title
  16.         alertDialog.setTitle("GPS is settings");
  17.  
  18.         // Setting Dialog Message
  19.         alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
  20.  
  21.         // Setting Icon to Dialog
  22.         //alertDialog.setIcon(R.drawable.delete);
  23.  
  24.         // On pressing Settings button
  25.         alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
  26.             public void onClick(DialogInterface dialog,int which) {
  27.                 Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  28.                 mContext.startActivity(intent);
  29.             }
  30.         });
  31.  
  32.         // on pressing cancel button
  33.         alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  34.             public void onClick(DialogInterface dialog, int which) {
  35.             dialog.cancel();
  36.             }
  37.         });
  38.  
  39.         // Showing Alert Message
  40.         alertDialog.show();
  41.     }
');