i have a public method in my MainActivity.java and want to call it from another Activity. Therefore i need the MainAcitivity Instance. How can i access it from another Acitivity.
Thanks
i have a public method in my MainActivity.java and want to call it from another Activity. Therefore i need the MainAcitivity Instance. How can i access it from another Acitivity.
Thanks
You can get help about message passing between activities by Broadcast Receivers
As already mentioned in comments that "This isn't something that should normally be required", but still if you want this you can make that method static in MainActivity.java.
public static void someMethod()
{
}
and then in another activity, call this way:
MainActivity.someMethod();