My mistake in choosing words. I didn't set a max, it is the target that I 
set.

The IDE also suggests putting the suppress tag on the method, but I have 
never been a fan of suppressing warnings or errors. If this is the accepted 
way to do it, however, then I will follow it.

Thanks!

On Thursday, January 29, 2015 at 7:09:08 AM UTC-7, MathieuB wrote:
>
> You shouldn't set a max sdk. You can set minSdk to 18, and targetSdk to 
> 21. If you set a max, that means if there's a new android version, people 
> won't be able to download your app, you'll have to make an update.
>
> As for the error you get, it's mainly a lint error. If the code is in an 
> if statement like you showed, there's no reason someone with API 18 enters 
> into this if statement. You'll just have to add @SuppressLint("NewApi") 
> before your method.
>
> Have a look at this stackoverflow page, it'll help.
>
>
> http://stackoverflow.com/questions/11592820/writing-backwards-compatible-android-code
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to