recommended way of saving state in onPause when the state needs to be flushed to a remote server:
in OnPause start a service(Android Service) and flush your state to server from that service and close the service after the completion of your desired task.