Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试访问除我的 BR 之外的类中的方法,因为它是一个引导完成的 BR,我无法覆盖其构造函数并传递参数。
我正在考虑尝试通过上下文,因为我想不出其他办法,唯一的问题是我找不到任何地方提到传递给它的上下文是什么。
任何帮助都感激不尽。
好的,我已经设法找出答案。如果有人需要这种信息,则传递的上下文是“android.app.ReceiverRestrictedContext”。
关于访问另一个类,我必须将其转换为单例类。
希望有一天它可以帮助某人..