1

I'm writing an app with 100+ (116 to be precise) Image Buttons. When I'm trying to run the app, it automatically closes and tells me the following:

The maximum view count defaults to 80 but can be configured with the environment variable ANDROID_LINT_MAX_VIEW_COUNT.

I need all of these Buttons, removing some of them isn't possible. What can I do? It says its bad for performance, but is it really that bad? Since its "just" a warning. Where can I configurate that environment variable? Or should I rather try to somehow lower the amount of buttons? (If yes, could you tell me how I can do that?)

HansUp
  • 95,961
  • 11
  • 77
  • 135
user2898518
  • 21
  • 1
  • 5

1 Answers1

4

First of all why do you have so many buttons? You might be able to achieve what you want using other UI components such as a ListView.

Anyways, it is a Lint warning:

The Android lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.

In Eclipse Lint warnings can be configured from:

Window -> Preferences -> Android -> Lint Error Checking.

enter image description here

Caner
  • 57,267
  • 35
  • 174
  • 180
  • ListView helps organizing it, but still, after about 80 entrys the app crashes. – user2898518 Oct 20 '13 at 12:11
  • In Android studio file->Settings->Code Style->Inspections. If you wish you can disable the warning "Layout has too many views" – BubbaGum Jul 06 '18 at 12:23
  • If you cannot compile, in the terminal write: set ANDROID_LINT_MAX_VIEW_COUNT=100 (set the value according to the number of views you have) – BubbaGum Jul 06 '18 at 19:09