It is very interesting. Even if you do not have a resource / image directory when you use:
myImageList = Arrays.asList(getResources().getAssets().list("images"));
You will see android-logo-mask.png and android-logo-shine.png listed in the results.
This made me wonder where the real image files in the Android code are. I don’t know the code base at all, but:
https://android.googlesource.com/platform/frameworks/base/+/master/core/res/assets/images/
lists these two in the resource directory under res. (Unlike the resource catalog, which stores my project assets that are not under permission).
The requirement to provide a path to a separate file for the AssetManagers list method (which returns an array) simply does not make any sense. And the documentation for the method says:
Returns a String array of all assets at the given path.
This makes me wonder if there was a mistake in the list method or if there was some other reason, it was intended to return certain system assets when a list of assets is required.
Similarly, if I use:
myAssetList = Arrays.asList(getResources().getAssets().list(""));
I see the included “sounds” and “web kit” that do not match any existing subdirectory of my assets.
source share