<How to return data from inside of addOnSuccessLis...
# stackoverflow
u
How to return data from inside of addOnSuccessListener{} method in Kotlin? I am trying to get user data from Firebase Firestore database , I am intended to get info of user who is currently logged in. Now for make this information accessible from other Classes I created get method for username and email, when I used get method from Another class , I got an indexOutOfBoundsException with index 0,size 0. It looks like my array in global scope is not getting data when i called array.add() method from addOnSuccessListener method. package...