Soru & Cevap

FireBase - RealTime Database Veri Güncelleme Sorunu.. ...

30.05.2020 - 03:06

Android Studio ile basit bir uygulama yapmaya çalışıyorum.. Ama bir yerde takıldım ve işin içinden çıkamıyorum.. Sorunum şu . . : Firebase Database den gelen puanın üstüne, son puanı alıp ekleyecek ve eski puanın üstüne yazacak.. Daha basit bir anlatımla..: EskiPuan = 50,, YeniPuan = 75.. GuncelPuan = EskiPuan+YeniPuan .. EskiPuan ı 125 olarak güncelleyecek.. 


public void PuanGuncelleme()
        mAuth = FirebaseAuth.getInstance();
        String user_id = mAuth.getCurrentUser().getUid(); 
        mDatabase = FirebaseDatabase.getInstance().getReference().child("Kullanıcılar").child(user_id); 
        mDatabase.addValueEventListener(new ValueEventListener() {
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

                user_puan = dataSnapshot.child("puan").getValue().toString(); 
                int USERPUAN = Integer.parseInt(user_puan);
                GenelToplam = String.valueOf(USERPUAN + skor);
                Map userUpdateMap = new HashMap();
                userUpdateMap.put("puan", GenelToplam);

            public void onCancelled(@NonNull DatabaseError databaseError) {


Bu şekilde bir kod bloğum var ama istediğim gibi çalışmıyor .. OnDataChange referansının in içinde olduğu içinde  sonsuz döngüye girip ben emilatörü durdurana kadar sürekli kayıt yapıyor..  Bu durumu nasıl düzeltebilirim acaba?

330 Görüntülenme

15 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

Profile picture for user phewpew
21.09.2021 - 12:41

The best online slots games on mobile phones in a new format, with a simple, fun playing style, not boring like playing slots in the old ways anymore. pgslotgame

Profile picture for user mrseo
08.06.2021 - 07:50

Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post.  Visit Website

Profile picture for user mrseo
08.06.2021 - 07:45

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job !  Visit Website

Profile picture for user mrseo
08.06.2021 - 07:34

Going to graduate school was a positive decision for me. I enjoyed the coursework, the presentations, the fellow students, and the professors. And since my company reimbursed 100% of the tuition, the only cost that I had to pay on my own was for books and supplies. Otherwise, I received a free master’s degree. All that I had to invest was my time.  Visit Website

Profile picture for user mrseo
08.06.2021 - 07:30

It is perfect time to make some plans for the future and it is time to be happy. I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!  Visit Website