Neha Shukla
Neha Shukla

Reputation: 3660

Call overridden method of Activity from other class

Hi I have an Interface and an Activity.

My Activity implements that Interface and have overrided the method of Interface.

now I have to call that overridden method of Interface from another Class so that overridden method of Activity gets executed.

Thanks in advance...

Upvotes: 1

Views: 344

Answers (2)

Piyush
Piyush

Reputation: 1973

just share the reference of the activity implementing the interface as the object of interface and then simply call the overridden method on that reference. Basic OOP concept.

Upvotes: 0

Neha Shukla
Neha Shukla

Reputation: 3660

I am able to call overridden method of Activity from other class as

 ((name of Interface) context).documentRead(dataUnit);

Upvotes: 2

Related Questions