开发者

Where to get Context from standalone native application?

开发者 https://www.devze.com 2023-02-15 10:24 出处:网络
A standalone native application should perform calls to Java VM. Creating VM and playing with classes seem to be OK, but there is a problem while obtaining instance of Context. I can not create Applic

A standalone native application should perform calls to Java VM. Creating VM and playing with classes seem to be OK, but there is a problem while obtaining instance of Context. I can not create Application object and use it (NullPointerException is thrown). Also, Context class is abstract and can not be instantiated. So开发者_StackOverflow中文版, where can I get the Context object?. Thanx.


Activity extends Context, so your Activity IS a Context.

0

精彩评论

暂无评论...
验证码 换一张
取 消