我的Android應用程序基本上是一個簡單的,其中有一個列表視圖與40個列表項。並且每個這些項目點擊時導致一個圖像。所以有40個圖像。如何將圖像以最佳方式包含到Android項目中?
我總是可以的,當然地方在res /文件夾繪製這些圖像和從我的java文件直接引用它們,在這種情況下會出現硬編碼完成
img.setImageResource(R.drawable.day1);
.
.
.
img.setImageResource(R.drawable.day3);
.
.
。 等
是否有(無論如何通過存儲圖像的名稱在一個xml例如)以編程方式從文件夾中檢索圖像名稱並顯示它們?
你好看待這個問題 [1 ]:http://stackoverflow.com/questions/6776575/android-how-can-i-dynamically-load-drawables-pictures-names-not-known-until – Herry