I have a funcation updateAtServer. There is a asyncTask. I want to finish this background thread completely first and after that this function should be return the values like as true or false.
But background thread is running and I am getting return values of that function before completing the asyncTask.
public static boolean hasUpdateAtServer_DeleteScore = false;
public static boolean hasUpdateAtServer_score= false;
public static boolean hasUpdateAtServer_swing= false;
public static boolean hasUpdateAtServer_courseDetailsHoles= false;
public synchronized static boolean updateAtServer(Context context) {
new UpdateIntoServer(context).execute();
return hasUpdateAtServer_DeleteScore && hasUpdateAtServer_score
&& hasUpdateAtServer_swing && hasUpdateAtServer_courseDetailsHoles;
}