开发者

How can I access an instance method/property of a Host from Test Bundle Fragment?

开发者 https://www.devze.com 2023-03-11 01:39 出处:网络
I have a bundle test.Bundle1 that have some properties fulfilled by Blueprint injections. I\'ve created one test fragment whose Host is test.Bundle1 and I would like to obtain myClassA instantiated

I have a bundle test.Bundle1 that have some properties fulfilled by Blueprint injections.

I've created one test fragment whose Host is test.Bundle1 and I would like to obtain myClassA instantiated singleton to access those properties.

I know that I could acess the bundle from a class开发者_开发问答 name using FrameworkUtil.getBundle(), but I don't know how to get the instance of this class.

How could I do that?

thanks

Cristiano


One way to go about this is to simply publish that instance as a service, so you can look it up in code that needs it.

0

精彩评论

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

关注公众号