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
.