Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit f70c857

Browse files
authored
Merge pull request #99 from samtstern/master
Update example permission
2 parents 4ae46a8 + fe78960 commit f70c857

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class MainActivity extends AppCompatActivity {
4040
### Request Permissions
4141

4242
The example below shows how to request permissions for a method that requires both
43-
`CAMERA` and `CHANGE_WIFI_STATE` permissions. There are a few things to note:
43+
`CAMERA` and `ACCESS_FINE_LOCATION` permissions. There are a few things to note:
4444

4545
* Using `EasyPermissions#hasPermissions(...)` to check if the app already has the
4646
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
5656
This can also be achieved by adding logic on the `onPermissionsGranted` callback.
5757

5858
```java
59-
@AfterPermissionGranted(RC_CAMERA_AND_WIFI)
59+
@AfterPermissionGranted(RC_CAMERA_AND_LOCATION)
6060
private void methodRequiresTwoPermission() {
61-
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.CHANGE_WIFI_STATE};
61+
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION};
6262
if (EasyPermissions.hasPermissions(this, perms)) {
6363
// Already have permission, do the thing
6464
// ...
6565
} else {
6666
// Do not have permissions, request them now
67-
EasyPermissions.requestPermissions(this, getString(R.string.camera_and_wifi_rationale),
68-
RC_CAMERA_AND_WIFI, perms);
67+
EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale),
68+
RC_CAMERA_AND_LOCATION, perms);
6969
}
7070
}
7171
```

app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void onClick(View v) {
5151
});
5252

5353
// Button click listener that will request two permissions.
54-
findViewById(R.id.button_location_and_wifi).setOnClickListener(new View.OnClickListener() {
54+
findViewById(R.id.button_location_and_contacts).setOnClickListener(new View.OnClickListener() {
5555
@Override
5656
public void onClick(View v) {
5757
locationAndContactsTask();

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
android:text="@string/camera" />
1818

1919
<Button
20-
android:id="@+id/button_location_and_wifi"
20+
android:id="@+id/button_location_and_contacts"
2121
android:layout_width="wrap_content"
2222
android:layout_height="wrap_content"
2323
android:text="@string/location_and_contacts" />

0 commit comments

Comments
 (0)