java - How do you call on/use files from outside the activity class in Android Studio? -


i create array of images drawable folder in class outside app activity class in android studio. can use getresources() method in activity. keep code clean , organized , creating array in activity may messy if accumulate more images. there similar or way access getresources() method outside class? trying generate randomized background using images in drawable folder. open suggestions new developer , may approaching problem incorrectly.

you not need activity per se hold of resources. activity extends context; context gives access resources. need class takes context if want reference of resources.


Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -