I try to save result of calling firebase functions from Android app.My function works well, because I see result in log. But I can't save it into variable for further use. Any ideas?
public void getUserRankFromFirebase(){
        mFunctions = FirebaseFunctions.getInstance();
        Map<String, Object> data = new HashMap<>();
        String resultFBFunctions = "";
        mFunctions
                .getHttpsCallable("getUserOnCall")
                .call(data)
                .addOnSuccessListener(getActivity(), new OnSuccessListener<HttpsCallableResult>() {
                    @Override
                    public void onSuccess(HttpsCallableResult httpsCallableResult) {
                            resultFBFunctions = httpsCallableResult.getData().toString();
                            Log.d("result1", httpsCallableResult.getData().toString()); //I see result here
                    }
                });
        Log.d("result2", resultFBFunctions); // No result here
    }
 
    