under gluon project how to get the Android assets

2019-09-17 11:51发布

问题:

I had creat a gluon project ,then I put some folders and files under assets folder(Android) and I want to read the files in application,now how do I can read the assets folder ? or how do I get the android Context or AssetManager ? under gluon project there is no Activity class or any class extends Activity.I had read all of the gluonMobile API, javaFXports API and developer docs, there is no help! Dose anyone can help me? I nearly got crazy!

回答1:

FXActivity which you obtain via FXActivity.getInstance extends Activity, thus you can call fxActivity.getAssets() to get an instance of AssetManager