问题描述:

I have a class that needs to access my application's main activity, but by design outside of my control I cannot pass an instance to it. Its purpose is to dynamically create a view and set it to the activity.

Is there a way for me to access the main activity through a static method? Or is there an alternative?

网友答案:

According to the comments above, maybe you need just static instance of context initialized in Application/Activity onCreate?

相关阅读:
Top