Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 0    Views: 84

tomtom
Aspiring developer
Profile
Posts: 20
Reg: Jan 18, 2011
location unknow...
1,450
03/26/14 04:23 AM (10 years ago)

API Specific Code

Hello Everyone, I'm trying to write some API specific code which will run only on higher APIs than I'm building for. This is what I have so far: if(android.os.Build.VERSION.SDK_INT >= 11){ webView.getSettings().setDisplayZoomControls(false); } I configured the project to use API level 8, in which setDisplayZoomControls is not available as a function. However, for API level 11, the function is available, which should make this code work. For some reason, Eclipse is still giving me an error that the setDisplayZoomControls function is not available, effectively ignoring the IF statement. Does anyone know why this might be happening? I also tried this syntax: if(android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.ECLAIR_0_1){ webView.getSettings().setDisplayZoomControls(false); } Still no joy. Any suggestions welcome!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.