The updated images in the asset folder do not appear during the launch application

is it possible to update assets folder on every update of app.I make a quiz app and it has images on assets folder.Number of images on folder shows when i launch the app.But when i update images on assets folder say from 10-20 images the actual total number of images to be shown on app is 20 but i still see 10 images.But when i uninstall and install app i do see all 20 images.how to updated assets folder without uninstalling app?

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;
    }
}

AFAIK Assets folder of android application will be initialized once at the time of installation only. You cannot update the assets folder after the application has been packaged and installed. After installation if you do any changes in the resources it will not reflect to your older installed version.As Asset folder is read only , you cannot write or update any file present there.

If you want to update it then you need to uninstall the older version and install new version.

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » The updated images in the asset folder do not appear during the launch application

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录