简体   繁体   English

如何一次性重新启动应用程序 - Firebase

[英]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.

相关问题 Android关闭我的应用程序然后如何我可以在x持续时间后重新启动我的应用程序? - Android when i close my app then How i can restart my app after x time duration? 如何重新启动Appcelerator Android应用程序? - How can I restart an appcelerator android app? 每次重新启动Android应用时,Firebase中的投票计数都会重置 - vote count in Firebase gets reset each time I restart my Android app 当用户在 Android 中关闭应用程序时,我如何重新启动应用程序 - how can i restart app when user close the app in Android 我如何在应用程序中使用 firebase 发送通知 - How can i send notification with firebase in app 如何在 Android 应用程序上运行自动机器人测试? 就像 Firebase 测试实验室上的那个 - How can I run an automatic robo test on Android app? like the one on Firebase Test Lab 如何在每次重新启动应用程序时阻止在Parse上创建新的对象ID? - How do I prevent creating a new object ID each time I restart the app, on Parse? 每次我重新启动应用程序时,Flutter 都会加载旧版本的应用程序 - Flutter loads old version of app every time I restart the app 我如何才能为我的 android 应用程序只创建一次使用启动画面 - How can i create only one time use splash screen for my android app 从浏览器手动将图像存储在 Firebase 存储中。如何使其反映在实时数据库中。 这样我就可以在 Android 应用程序中获取 - Manually Storing images in Firebase Storage from browser .How to make it reflect in real time database. so that I can fetch in Android app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM