https://kotlinlang.org logo
Title
z

zokipirlo

12/14/2018, 9:32 AM
I have a custom Application class which I want to convert to Interface and currently a lot of methods thinks that it's also Context, but when I change to Interface it's of course not, even when I implemented that interface it becomes, because implementation class extends Application. Is it possible to create an Interface which is somehow marked that is also Context? Something like expect functions.
k

kagomez

12/14/2018, 11:47 AM
Why would you like to do that? and no, Context is not an interface so it can't be inherit by your interface; interfaces can only inherit other interfaces
z

zokipirlo

12/14/2018, 1:14 PM
I need to merge two applications together and can't extend from two classes. I fixed with exposing getContext method and calling it when I need it.