Skip to content
Advertisement

Unconditional layout inflation from view adapter warning

I am using GridView in my alert dialogue with below codes.its giving me error called in title. My codes and more required information is like below.

JavaScript

and Adapter like this

JavaScript

its giving me warning on this line

JavaScript

warning is like below

JavaScript

My code is working fine as expected and I am not facing any issue. I want know that What changes require for fix this and what is benefit of it ? Let me know if someone can help me for come out from this and solve my doubt.

Thanks

Advertisement

Answer

View adapter is built so that instead of creating a new view for each item, views that scroll off screen can be reused (they are passed in via the 2nd argument of getView). You are being warned that you should try to reuse these views instead of always inflating new ones. Change the line to

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement