Where to put drawable resources for an OpenFL andr

2019-05-10 04:00发布

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条回答
来,给爷笑一个
2楼-- · 2019-05-10 04:02

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"));
查看更多
登录 后发表回答