I can not understand where the error, please suggest:
private class GetUserObject extends AsyncTask<Void, Void, Map<String, Object>> { @Override protected Map<String, Object> doInBackground(Void... params) { dataService.getFirebaseUsers().child(userPreferences.getUID()).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { Post = (Map<String, Object>) snapshot.getValue(); Log.e("userBG ", "background"); } @Override public void onCancelled(FirebaseError firebaseError) { } }); return Post; } protected void onProgressUpdate(Void... progress) { Log.e("userProgress ", "progress"); } protected void onPostExecute(Map<String, Object> somemap){ super.onPostExecute(Post); //UserData userData = new UserData(Post); Log.e("userPE ", "after loading"); } } The point is that I get the execution of onPostExecute () until the completion of the execution of doInBackground. In the log:
04-22 08:24:09.343 E/userPE: after loading 04-22 08:24:09.473 E/userBG: background
Asynctask. - Vladyslav Matviienko