是可以更新資產文件夾app.I的每次更新使測驗應用程序,其對文件夾的圖像的資產folder.Number有圖像顯示,當我啓動應用程序。但是當我更新資產文件夾中的圖像說,從10-20圖像應用程序上顯示的圖像的實際總數是20,但我仍然看到10 images.But當我卸載並安裝應用程序,我會看到所有20 images.how更新資產文件夾,而無需卸載應用程序?更新的圖像文件夾沒有出現在啓動應用程序
String[] getImagesFromAssets() {
String[] img_files = null;
try {
img_files = getAssets().list("pictures");
} catch (IOException ex) {
Logger.getLogger(GameActivity.class
.getName()).log(Level.SEVERE, null, ex);
}
return img_files;
}
void loadImage(String name) {
try {
InputStream ims = getAssets().open("pictures/" + name);
Drawable d = Drawable.createFromStream(ims, null);
image.setImageDrawable(d);
} catch (IOException ex) {
return;
}
}
丟棄任何expections是一種不好的做法。大多數時候你都會遇到麻煩。 –
@BinoyBabu pardon。你能幫我找到解決辦法嗎? –
使用'catch(IOException ioe){ioe.printStackTrace(); }'獲得更多的調試信息並在這裏發佈跟蹤。 –