|
|
@ -92,6 +92,8 @@ public class NavigationHelper { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { |
|
|
|
if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { |
|
|
|
// Never asked again: show a dialog with an explanation
|
|
|
|
// Never asked again: show a dialog with an explanation
|
|
|
|
|
|
|
|
activity.runOnUiThread(new Runnable() { |
|
|
|
|
|
|
|
public void run() { |
|
|
|
new MaterialDialog.Builder(context).content(R.string.permission_readtorrent).positiveText(android.R.string.ok) |
|
|
|
new MaterialDialog.Builder(context).content(R.string.permission_readtorrent).positiveText(android.R.string.ok) |
|
|
|
.onPositive(new MaterialDialog.SingleButtonCallback() { |
|
|
|
.onPositive(new MaterialDialog.SingleButtonCallback() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -99,6 +101,8 @@ public class NavigationHelper { |
|
|
|
ActivityCompat.requestPermissions(activity, new String[]{permission}, requestCode); |
|
|
|
ActivityCompat.requestPermissions(activity, new String[]{permission}, requestCode); |
|
|
|
} |
|
|
|
} |
|
|
|
}).show(); |
|
|
|
}).show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
// Permission not granted (and we asked for it already before)
|
|
|
|
// Permission not granted (and we asked for it already before)
|
|
|
|