Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i get value without using event listeners in firebase on android?

I'm making an Android application using new version of Google Firebase Realtime Database.

I am getting my datas with ValueEventListener and ChildEventListener when data changed/added/deleted/moved etc..

Now, i have a problem.

My data is :

"user 1": {
    "name":"abc"
}

and i have an a Button that named "getName".

I want to get value of "name" in user 1 data when i clicked the getName button.

    getName.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            bla bla..
        }
    });

Is it possible? Can i get value without using listeners?

i m waiting your helps. thank you.

like image 974
umon Avatar asked Jun 04 '16 10:06

umon


1 Answers

Not actually true it will change every time you change the data and it will probably call all of your activites which is pretty useless i don't even know why they made it that way....waiste of time.

like image 139
Izvorski Avatar answered Oct 06 '22 16:10

Izvorski