app/src/main/java/com/project/hellonepal/GPSTracker1.java
public void showSettingsAlert(){
		AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
   	 
        // Setting Dialog Title
        alertDialog.setTitle("GPS settings");
 
        // Setting Dialog Message
        alertDialog.setMessage("GPS is not enable. Do you want to go to settings menu?");
 
        // On pressing Settings button
        alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,int which) {
            	Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
            	mContext.startActivity(intent);
            }
        });
 
        // on pressing cancel button
        alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
            }
        });
 
        // Showing Alert Message
        alertDialog.show();
	}
/**
	 * Function to show settings alert dialog
	 * On pressing Settings button will lauch Settings Options
	 * */
Function to show settings alert dialog
On pressing Settings button will lauch Settings Options
Function to show settings alert dialog On pressing Settings button will lauch Settings Options
public void showSettingsAlert(){
		AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
        alertDialog.setTitle("GPS settings");
        alertDialog.setMessage("GPS is not enable. Do you want to go to settings menu?");
        alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog,int which) {
            	Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
            	mContext.startActivity(intent);
            }
        });
        alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
            }
        });
        alertDialog.show();
	}
public void showSettingsAlert ( ) { AlertDialog . Builder alertDialog = new AlertDialog . Builder ( mContext ) ; alertDialog . setTitle ( "GPS settings" ) ; alertDialog . setMessage ( "GPS is not enable. Do you want to go to settings menu?" ) ; alertDialog . setPositiveButton ( "Settings" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { Intent intent = new Intent ( Settings . ACTION_LOCATION_SOURCE_SETTINGS ) ; mContext . startActivity ( intent ) ; } } ) ; alertDialog . setNegativeButton ( "Cancel" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { dialog . cancel ( ) ; } } ) ; alertDialog . show ( ) ; }
Function to show settings alert dialog
 On pressing Settings button will lauch Settings Options
Function to show settings alert dialog On pressing Settings button will lauch Settings Options
// Setting Dialog Title // Setting Dialog Message // On pressing Settings button // on pressing cancel button // Showing Alert Message