public static void postAsync(final Runnable runnable) { asyncExecutor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { try { runnable.run(); } catch (final Exception e) { // throw on main thread, async executor will catch them Gdx.app.postRunnable(new Runnable() { @Override public void run() { throw e; } }); } return null; } }); }
protected void writeLogToDB(final LogEntry logEntry) { asyncExecutor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { logDAO.WriteToDatabase(logEntry); return null; } }); }
@Override protected void logDebug(final String tag, final String message) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.debug(tag, message); return null; } }); }
@Override protected void logDebug(final String tag, final String message, final Throwable exception) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.debug(tag, message, exception); return null; } }); }
@Override protected void logInfo(final String tag, final String message) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.log(tag, message); return null; } }); }
@Override protected void logInfo(final String tag, final String message, final Throwable exception) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.log(tag, message, exception); return null; } }); }
@Override protected void logError(final String tag, final String message) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.error(tag, message); return null; } }); }
@Override protected void logError(final String tag, final String message, final Throwable exception) { executor.submit(new AsyncTask<Void>() { @Override public Void call() throws Exception { Gdx.app.error(tag, message, exception); return null; } }); }