Just create a singleton, for example:
TeacherDashboardSingleton:
public class TeacherDashboardSingleton { public Teacher_Dashboard aa; private static final TeacherDashboardSingleton ourInstance = new TeacherDashboardSingleton(); public static TeacherDashboardSingleton getInstance() { return ourInstance; } }
class myActivity:
onCreate(....){ .... TeacherDashboardSingleton.getInstance().aa = this; .... }
this will create an object of the same instance as in action
now you can use it from anywhere
Abhinay sharma
source share