newSingleThreadExecutor
ExecutorService executor = Executors.newSingleThreadExecutor();
try {
executor.execute(() -> {
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
// Instance ID token to your app server.
// refresh token
FirebaseTokenSender.refreshTokenToJfw(
getApplicationContext(),
token);
});
} catch (Exception e) {
logger.error("{}", e.getMessage());
} finally {
executor.shutdown(); // <== some function do not call shutdonw ?
}Last updated