public ApiMethodsImpl(final ApplicationService appService) { this.appService = appService; this.lastOperationDump = appService.getSharedPreferences("last-operation", Context.MODE_PRIVATE); loadLastOperation(); defaultErrorMessage = appService.getString(R.string.error_server_default); mainWorker = new HandlerThread("api-thread"); mainWorker.start(); mainHandler = new ApiMethodsHandler(mainWorker.getLooper()); if (DEBUG) { Log.d(TAG, "Worker thread is now alive " + this); } }