سؤال

Android Lint thinks I have some unused resources, like data0454.xml whereas actually the file is being used in a loop, like this:

"data" + numberString + ".xml"

What should I do about this - change my program design, or try to hide the Android Lint warning?

هل كانت مفيدة؟

المحلول

You can't refer to resources via "data" + numberString + ".xml". Resources do not have file extensions.

That being said, assuming that are you are actually getting the resources (e.g., getResources().getIdentifier()), you'll probably want to suppress the Lint warning for this project.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top