diff --git a/README.md b/README.md index be2bd2c..af03ed0 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ public class MainActivity extends AppCompatActivity { ### Request Permissions The example below shows how to request permissions for a method that requires both -`CAMERA` and `CHANGE_WIFI_STATE` permissions. There are a few things to note: +`CAMERA` and `ACCESS_FINE_LOCATION` permissions. There are a few things to note: * Using `EasyPermissions#hasPermissions(...)` to check if the app already has the required permissions. This method can take any number of permissions as its final @@ -56,16 +56,16 @@ The example below shows how to request permissions for a method that requires bo This can also be achieved by adding logic on the `onPermissionsGranted` callback. ```java -@AfterPermissionGranted(RC_CAMERA_AND_WIFI) +@AfterPermissionGranted(RC_CAMERA_AND_LOCATION) private void methodRequiresTwoPermission() { - String[] perms = {Manifest.permission.CAMERA, Manifest.permission.CHANGE_WIFI_STATE}; + String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION}; if (EasyPermissions.hasPermissions(this, perms)) { // Already have permission, do the thing // ... } else { // Do not have permissions, request them now - EasyPermissions.requestPermissions(this, getString(R.string.camera_and_wifi_rationale), - RC_CAMERA_AND_WIFI, perms); + EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale), + RC_CAMERA_AND_LOCATION, perms); } } ``` diff --git a/app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java b/app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java index 98ea20f..e71bf5c 100644 --- a/app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java +++ b/app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java @@ -51,7 +51,7 @@ public void onClick(View v) { }); // Button click listener that will request two permissions. - findViewById(R.id.button_location_and_wifi).setOnClickListener(new View.OnClickListener() { + findViewById(R.id.button_location_and_contacts).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { locationAndContactsTask(); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f4fad74..b93dcf2 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -17,7 +17,7 @@ android:text="@string/camera" />