Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7 from JcMinarro/hotfix/#5-requesting_some_permis…
Browse files Browse the repository at this point in the history
…sions_doesnt_work

Fix Issue #5, RequestCode couldn't be negative
  • Loading branch information
Serchinastico committed Nov 18, 2015
2 parents ea8dc4f + 3994fa2 commit dd19f96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dexter/src/main/java/com/karumi/dexter/Dexter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.karumi.dexter;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import com.karumi.dexter.listener.PermissionListener;

Expand All @@ -33,7 +32,7 @@ public final class Dexter {
/**
* Initializes the library
*
* @param context Context used by Dexter. Use your {@link Application} to make sure the instance
* @param context Context used by Dexter. Use your {@link android.app.Application} to make sure the instance
* is not cleaned up during your app lifetime
*/
public static void initialize(Context context) {
Expand Down
2 changes: 1 addition & 1 deletion dexter/src/main/java/com/karumi/dexter/DexterInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ private void finishWithDeniedPermission(String permission) {
}

private int getPermissionCodeForPermission(String permission) {
return permission.hashCode();
return Math.abs(permission.hashCode() % Integer.MAX_VALUE);
}
}

0 comments on commit dd19f96

Please sign in to comment.