Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RefreshActionItem contains a switch statement with Resource id's #2

Open
jtietema opened this issue Apr 17, 2013 · 6 comments
Open

Comments

@jtietema
Copy link

As of SDK tools r14 library resource id's are not final and thus should not be used in switch statements.

More on this can be read in the SDK changelog http://tools.android.com/recent/buildchangesinrevision14

@ManuelPeinado
Copy link
Owner

How come this works fine with v21 of the SDK tools? Maybe this was a v14 change which got reverted?

@jtietema
Copy link
Author

Well it works because the switch statement will receive an int anyway, but
it might not have the values you expect.

I use the latest SDK tools myself and the error comes from android lint. If
you run Android Lint over the file to see the explanation yourself.

PS. Great little library btw. Found it very usefull

On Wed, Apr 17, 2013 at 6:02 PM, ManuelPeinado [email protected]:

How come this works fine with v21 of the SDK tools? Maybe this was a v14
change which got reverted?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-16514915
.

@ManuelPeinado
Copy link
Owner

Really glad you find it useful, thanks!

Regarding this issue, I can't seem to get lint to complain about it. I'm using the lastest version of the tools (21.1).

@jtietema
Copy link
Author

Park the issue for the moment, I'll investigate further and try to create a
test case to demonstrate the issue.

On Wed, Apr 17, 2013 at 9:06 PM, ManuelPeinado [email protected]:

Really glad you find it useful, thanks!

Regarding this issue, I can't seem to get lint to complain about it. I'm
using the lastest version of the tools (21.1).


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-16526536
.

@ManuelPeinado
Copy link
Owner

Ok. Thanks a lot for helping out.

On Thu, Apr 18, 2013 at 11:16 AM, Jeroen Tietema
[email protected]:

Park the issue for the moment, I'll investigate further and try to create
a
test case to demonstrate the issue.

On Wed, Apr 17, 2013 at 9:06 PM, ManuelPeinado [email protected]:

Really glad you find it useful, thanks!

Regarding this issue, I can't seem to get lint to complain about it. I'm
using the lastest version of the tools (21.1).


Reply to this email directly or view it on GitHub<
https://github.com/ManuelPeinado/RefreshActionItem/issues/2#issuecomment-16526536>

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-16565939
.

@lucky-tom
Copy link

Hi Manuel Peinado,

In my IDE :Android Studio 1.2.2 ,I have problem same as jtietema, I found this tips :

Resource IDs cannot be used in a switch statement in Android library modules

so I use ''if else'' instead of "switch case"

see here : http://stackoverflow.com/questions/17849566/switch-case-expressions-must-be-constant-expressions-i-cant-make-the-if-else

Oh ha ha, I am not good at English. Please don't laugh at me .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants