i have defined a function in mainactivity now i want to access with another class in my app.I have created a object of the mainactivity by using that object i have called th
Activity A should have a variable
static ActivityA activityA;
In onCreate state:
activityA = this;
and add this method:
public static ActivityA getInstance(){ return activityA; }
In activity B, call
ActivityA.getInstance().myFunction(); //call myFunction using activityA