How to add like counter Android Studio Firebase
How to add like counter Android Studio Firebase this is the database link 1can anybody help me to add a like counter to this.please please it should display the no:of likes and decease it when like is taken back my java code is below private void onLikeClicked(View v) { boolean isLiked = !btnLike.isSelected(); final String currentUserKey = User.currentKey(); DatabaseReference likes = FirebaseDatabase.getInstance().getReference().child(Const.kDataLikeKey); DatabaseReference curLike = likes.child(mPostRef.getKey()).child(currentUserKey).child("liked"); // update Model curLike.setValue(isLiked); // update UI btnLike.setSelected(isLiked); } This increment like count but doesn't decrements it i want it to get decremented when clicked back 1 Answer 1 Your question is not entirely clear but if you are trying to make a functionality like social media post wher...