[英]How can I restart app one time - Firebase
I have to update data on firebase database.我必须更新 firebase 数据库上的数据。 After I need restart my app ONE TIME.
在我需要重新启动我的应用程序一次之后。 How can I do that ?
我怎样才能做到这一点 ?
FirebaseDatabase.getInstance().getReference("User")
.child(Common.currentUser.getPhone()).child("country")
.setValue(addresses.get(0).getCountryName());
FirebaseDatabase.getInstance().getReference("User")
.child(Common.currentUser.getPhone()).child("city")
.setValue(addresses.get(0).getLocality());
FirebaseDatabase.getInstance().getReference("User")
.child(Common.currentUser.getPhone()).child("ilce")
.setValue(addresses.get(0).getSubAdminArea());
You should never need to restart an app just to get new data from Realtime Database.您永远不需要为了从实时数据库中获取新数据而重新启动应用程序。 You should adjust the internal state of your app as needed.
您应该根据需要调整应用程序的内部状态。 You can even set up a listener on the locations that may change in order to receive updates as soon as they happen.
您甚至可以在可能更改的位置上设置侦听器,以便在发生更新时立即接收更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.