简体   繁体   中英

How to load assets with asset manager on Android?

I'm trying to load a skin from the asset manager:

public Assets() {
    manager = new AssetManager();

    manager.load("bin/fonts/loading.json", Skin.class);
    manager.finishLoading();
    loadingSkin = manager.get("bin/fonts/loading.json", Skin.class);
}

This works on desktop, but on Android the asset manager can't load the JSON, and it throws an exception.

将工作目录设置为android run配置中的assets目录。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM