There are 3 handler
in my fragment
all those contain AsyncTask
, and the fragment
contains an int
value, for example 50. Here what I wanted to do is to compare those 3 int
value (which I am fetching in those 3 AsyncTask
in handler
) with the int
value defined in fragment
. For example if AsyncTask
in handler-1
gets 80, AsyncTask
in handler-2
gets 10, AsyncTask
in handler-3
gets 46, then I want to compare these 3 ints
with that fragment int
.
I forgot to tell that after comparison, mFragmentValue
needed to update with new value from onPostExecute()
.
My code is big to post here, so here is an example:
class MyFragment{
int mFragmentValue = 50;;
void onViewCreated(){
handler1.post(calling AsyncTask here using runnable); //Here I get 80 in onPostExecute in MyAsyncTask, now I need to compare this 80 with mFragmentValue. These AsyncTasks are sub class of my fragment.
handler2.post(calling AsyncTask here using runnable); //Here I get 10 in MyAsyncTask, now I need to compare this 10 with mFragmentValue;
handler3.post(calling AsyncTask here using runnable); //Here I get 46 in MyAsyncTask, now I need to compare this 46 with mFragmentValue;
}
static class MyAsyncTask extend AsyncTask{
void onPostExecute(){
// getting int here.
//need to compare fetched int with mFragmentValue;
}
}
}