How to reference the current or main activity from another class March 3, 2023 by Tarik If you already have a valid context, just use this: Activity activity = (Activity) context;