How to fix “V/FA: Inactivity, disconnecting from the service”

51
April 15, 2019, at 5:00 PM

I'm coding a game to play online throught the firestore service. It's a one to one game. The game works correctly, but the problem is that in the player one device the app continously call to the onCreate method in the Android Activity and the screen is reloaded completely.

In the logcat appear:

V/FA: Inactivity, disconnecting from the service

But this problem only appear in one device. In the player one device, not in the player two.

In another thread the people say that the problem is with the Android Studio cache, but it doesn't works for me: V/FA: Inactivity, disconnecting from the service

    private void gameListener() {
        listenerJugadas = db.collection("games")
                .document(gameId)
                .addSnapshotListener(GameActivity.this, new EventListener<DocumentSnapshot>() {
                    @Override
                    public void onEvent(@Nullable DocumentSnapshot snapshot, @Nullable FirebaseFirestoreException e) {
                        if (e != null) {
                            Toast.makeText(GameActivity.this, "Error while loading!", Toast.LENGTH_SHORT).show();
                            Log.d("TAG", e.toString());
                            return;
                        }
                        String source = snapshot != null && snapshot.getMetadata().hasPendingWrites()
                                ? "Local" : "Server";
                        if(snapshot.exists() && source == "Server") {
                            jugada = snapshot.toObject(Jugada.class);
                            if(playerOneName.isEmpty() || playerTwoName.isEmpty()) {
                                getPlayerNames();
                            }
                            updateUI();
                        }
                    }
                });
    }
READ ALSO
How to add a FrameLayout in the footer of RecyclerView in the Fragment

How to add a FrameLayout in the footer of RecyclerView in the Fragment

I use the ListView and addFooterView to insert a FrameLayout in the Fragment, it's works!

16
How to navigate from contentView to fragment

How to navigate from contentView to fragment

I would like to know how to move from a ContentView to fragment

20
Build failed showing error &ldquo;Attribute &rdquo;android:focusable&ldquo; was already specified for element &rdquo;EditText"

Build failed showing error “Attribute ”android:focusable“ was already specified for element ”EditText"

my code is not being build when trying to run it on device or emulator with the error Error:Attribute "android:focusable" was already specified for element "EditText"but it gradle build is successful

52
Errors when changing Android version (Target Framework) in Xamarin Forms

Errors when changing Android version (Target Framework) in Xamarin Forms

I have a C# Xamarin Forms Solution in Visual Studio 2019 that was created from the Xamarin Forms Template

52