鑑於以下DB計劃: 火力地堡不調用OnChildChanged活動
我要聽任何mHotZoneRecord變化。這樣做,我做了如下:
mDBRefUsers = mDatabase.getReference("https://stackoverflow.com/users/");
mDBRefUsers.child("mHotZoneRecord").addChildEventListener(new HotZoneNotification(this));
和其他地方的代碼中,實現HowZoneNotification
類
class HotZoneNotification extends TableSyncInfo
implements ChildEventListener {
OnChildChanged();
OnChildAdded();
}
的問題是我不是任何得到OnChildChanged事件。
我在做什麼錯了?
'只有在'/ users'下的現有節點發生變化時,纔會調用'onChildChanged()'。 –
你沒有實現這些方法嗎?也許我們可以幫助更多,如果你顯示'HotZoneNotification'的完整實現 –
這些已經實現,但由我刪除,因爲在我看來這個例子並不重要,因爲回調本身沒有被調用,並且mDbLitute和mdbLongtitude做了改變 –