From 59b705cc7332aaf3b8a8c9e4763b9fab266d7473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Thu, 2 Oct 2014 16:02:20 +0200 Subject: [PATCH] Exec isAvailble on separate thread --- src/android/Printer.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/android/Printer.java b/src/android/Printer.java index c5dcf51..d4b8458 100644 --- a/src/android/Printer.java +++ b/src/android/Printer.java @@ -91,10 +91,15 @@ public class Printer extends CordovaPlugin { * A Internet connection is required to load the cloud print dialog. */ private void isAvailable () { - Boolean supported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; - PluginResult result = new PluginResult(PluginResult.Status.OK, supported); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + Boolean supported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; + PluginResult result = new PluginResult(PluginResult.Status.OK, supported); - command.sendPluginResult(result); + command.sendPluginResult(result); + } + }); } /**