Back to project page sami-android-demo.
The source code is released under:
Apache License
If you think the Android project sami-android-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package io.samsungsami.android.api; /*from www .j a v a 2s . c o m*/ import java.util.concurrent.ExecutionException; public class Call { private Code code; private Callback callback; public Call(final Code code){ this.code = code; this.callback = null; } public Call(Code code, Callback callback){ this.code = code; this.callback = callback; } /** * Async mode. Executes callback code after the task is finished */ public void execute(){ new Task(code, callback).execute(); } /** * Sync mode. Blocking call until it returns the result * @return */ public Object executeInSync(){ try { return new Task(code).execute().get(); } catch (InterruptedException e1) { e1.printStackTrace(); } catch (ExecutionException e1) { e1.printStackTrace(); } return null; } }