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.
activity从另一个调用函数的正确方法是什么activity。我曾经通过创建static object第一个activity并从第二个调用它来做到这一点activity。但是这种方法据说会导致内存泄漏。那么什么是正确的方法呢?
activity
static object
您描述的方法仅在您将上下文/活动存储在某处时才会导致内存泄漏。
android sdk 中有一些类使用相同的方法(例如 Toast)