Where to put drawable resources for an OpenFL android extension?

霸气de小男生 提交于 2019-12-07 18:16:38

问题


I am making an android extension for my OpenFL app, which is supposed to show a notification, when I call a function from Haxe.

I need to put a drawable icon in my extension project, because a notification requires an icon.

However, the Java file extends an "Extension" class, which provides the object - Extension.assetManager (android.content.res.AssetManager)

How do I use this to access a drawable similar to R.drawable....?

And also where to put drawable resources for the OpenFL android extension?


回答1:


It looks like AssetManager can access files in the "assets" folder, so I suspect what you need to do is create this folder in the root of the extension project. To open the file, you'd use something like this:

Bitmap bitmap = BitmapFactory.decodeStream(AssetManager.open("filename.png"));


来源:https://stackoverflow.com/questions/25202957/where-to-put-drawable-resources-for-an-openfl-android-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!