質問

since I updated my Android SDK today I get some strange Lint errors in my project. The activity contains amongst others a textview. Everything works fine, but if I want to change the text size of the view within the code with .setTextSize(float size), I get in other lines (and also other independent methods) errors that a call requires a certain API level. But that are calls like string.isEmpty(), which is available since API level 1. What am I missing? And I know, I can set the text size also in the xml-file, but I want to change it during runtime.

Any ideas? Thanks!

Best regards Tobi

役に立ちましたか?

解決

I think I got into something similar some time ago (nonsense Lint errors)... Are you working with Eclipse? If so, you can try the following:

  1. Restart Eclipse
  2. Clean your project (Project->clean...)
  3. Click the button "Runs Android Lint..." (it's in the toolbar, between the "Virtual device manager" and the "new project wizard")

I don't remember exactly what did I do to solve the problem, I hope it works though Good luck!

他のヒント

With the latest release, I've had a few times where the lint errors were just incorrect. (missing semicolon on a line with a semicolon, etc).

In such cases, you can right-click on lint error warning, or on the numberings on the left side, and select "Clear All Lint Markers".

This will allow you to compile the file once, and if that works, Lint seems to start acting normally again.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top