Home » Android » Performance on loading string array multiple times from Android resources-Exceptionshub

Performance on loading string array multiple times from Android resources-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I have lot of string array in Android res folder, those must be used multiple times in different places of the application.

It is safe performance side to call every time:

getContext().getResources().getStringArray(R.array.resource_id);

Does Android use an internal optimization or must I cache arrays to avoid to load the same data multiple times from resources?

How to&Answers: