有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Firebase GeoFire设置位置未在服务中工作

好的,我有下面的代码,它可以正常工作,但是当我破坏活动时,它就会停止工作

DatabaseReference ref2 = FirebaseDatabase.getInstance().getReference("REFERENCE");
                    GeoFire mGeoFire = new GeoFire(ref2);
                    mGeoFire.setLocation(
                            "KEY",
                            new GeoLocation(location.getLatitude(), location.getLongitude()),new
                                    GeoFire.CompletionListener(){
                                        @Override
                                        public void onComplete(String key, DatabaseError error) {
                                            //Do some stuff if you want to
                                            Log.e(TAG, "onLocationChanged - in Firebase onComplete: "+error );

                                        }
                                    });

除了应用程序被终止外,其他一切都正常工作

编辑我也尝试过将服务作为单独的流程,但仍然没有成功


共 (0) 个答案