Permissionsdispatcher: Lint showing "Useless @OnShowRationale declaration"

Created on 26 Nov 2017  路  4Comments  路  Source: permissions-dispatcher/PermissionsDispatcher


Overview

  • Describe the issue briefly

I updated the library to 3.0.1 from 2.4.0 and now I'm seeing a Lint error saying "Useless @OnShowRationale declaration". It's not stopping me from compiling my code but I'm wondering why it's showing up because when I remove it, the function is no longer being used. Maybe it's because I'm checking for 2 permissions in the same Fragment?

Expected

  • What is the expected behavior?

I guess not for it to show up since it doesn't seem to be useless.

Actual

  • What is the actual behavior?

Environment

  • Which library version are you using?

3.0.1

  • On which devices do you observe the issue?
  • Note any other information that might be useful

Reproducible steps

  • While it's not required, it'd be perfect to add a link to a sample project where you encounter the issue

It's happening in this class

bug contributionwelcome

Most helpful comment

@imminent, I was able to avoid the warning by swapping the order which those methods are declared.

All 4 comments

@silverAndroid Sorry for the late. It's kinda weird so let us investigate 馃檱

I see it too.
It's only show in Fragment in my project.

I have this problem:

@OnShowRationale(Manifest.permission.ACCESS_FINE_LOCATION)
void showRationaleForLocationPermission(PermissionRequest request) { }

@NeedsPermission(Manifest.permission.ACCESS_FINE_LOCATION)
void getLocationPermissionAndLaunchMarket() { }

I see this same warning for useless OnShowRationale. Using 3.1.0

@imminent, I was able to avoid the warning by swapping the order which those methods are declared.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rishabh876 picture rishabh876  路  5Comments

SUPERCILEX picture SUPERCILEX  路  3Comments

fanmingyi picture fanmingyi  路  3Comments

vincentnock picture vincentnock  路  4Comments

alvindizon picture alvindizon  路  3Comments