i am working on my android project & want a little help. I have two classes . one of them is an AsyncTask class which is used to connect to web server for downloading some information & other one is an Activity Class which is used to display these information. i think my problem is clear and was asked by many developers before.i don't know how to return these information to the Activity class! I used to create AsyncTask class inside of Activity class & With this method , i was able to put the result in the variables of Activity Class but after a while i found it was against of OOP's concepts so i need to separate these two classes.
Fact
AsyncTask class has two important methods . the first one is doInBackground which prepares the result. after that in onPostExecute you can manipulate the result .
what have i tried to achieve this goal ?
Actually i searched google but didn't find anything useful! there was only one attractive solution which was accepted although i couldn't use it! it suggests creating an interface class but it was not clear.Do you think , it is the only solution ? Do you have any solution for my problem ?
Create an interface and implement it in Activity.
In AsyncTask class
In activity implement interface