I’m trying to solve a problem where the Android version of our app is not updating when the application has lost focus. Note, this is not the same as running in the background. My app is still in the foreground but the keyboard is open for example or the app is running in split-screen mode.
I’m writing a chat feature and in this instance, I’m finding that the polling is not being processed while the Android keyboard is open so new chat messages are not received. I’m also not able to modify the UI while the focus is lost.
Is there a way to handle this?
Thanks
I think the only way around this is to modify the activity and handle focus loss, because the default handling does pause the player.
When you say “handle the focus loss” do you mean call a custom service or something? Or is there a way I can force unity to continue updating
I don’t think there is a way to configure this ATM.
What I mean is that you can export Android Studio project from Unity and modify activity java code. We also support using custom activity class, probably you want to use that once you have it working.
So I’ve played around with this but I’m not sure what I should be changing. I still need to send the events to Unity when the application loses focus so my app responds to them appropriately but if I override this in my custom activity which is called when the keyboard opens
@Override
public override void onWindowFocusChanged(boolean var1) {
super.onWindowFocusChanged(var1);
// do something?
}
What do I call to keep the application ticking? I can’t find anything that helps
@Aurimas-Cernius anything more you can suggest? This is really important to our apps usability
One last bump as I’d really like to fix this