I have a class that looks for a list of clients in the background with a AsyncTask
. It can be called from any Activity
, and returns nothing, just fetches the list of clients that comes in json
and saves that list as string
to SharedPreferences
.
Initially, I am ordering to get the list on my login screen, so when I bring the user data from the database, it already has to fetch the list of clients (to reduce waiting for data search), but I I needed that when that class saved the list in SharedPreferences
my Activity
that is opened after login was notified so I fill a RecyclerView
with it. I thought of Implementing a Interface
in AsyncTask
but it returns to the Activity
that called it.
Is there a method that notifies Activity
even though the function has not been started by it?
Note: If you have not understood the question, comment before you deny that I will be happy to answer your questions.