Exec isAvailble on separate thread

This commit is contained in:
Sebastián Katzer 2014-10-02 16:02:20 +02:00
parent 1be8b958ce
commit 59b705cc73

View File

@ -91,11 +91,16 @@ public class Printer extends CordovaPlugin {
* A Internet connection is required to load the cloud print dialog. * A Internet connection is required to load the cloud print dialog.
*/ */
private void isAvailable () { private void isAvailable () {
cordova.getThreadPool().execute(new Runnable() {
@Override
public void run() {
Boolean supported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; Boolean supported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
PluginResult result = new PluginResult(PluginResult.Status.OK, supported); PluginResult result = new PluginResult(PluginResult.Status.OK, supported);
command.sendPluginResult(result); command.sendPluginResult(result);
} }
});
}
/** /**
* Loads the HTML content into the web view and invokes the print manager. * Loads the HTML content into the web view and invokes the print manager.