diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-27 18:16:37 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-27 18:16:37 +0100 |
commit | bc2d8fa1da02037d0b9a2361f394f19e494c8cec (patch) | |
tree | 3ac5f8f2af6f528e6c0cab51b95837ecffb8fc2d /same-android/src/main/java/com/orbekk/same/VariableTestActivity.java | |
parent | f7d27ef6204bd7ea96c657fa5399db8e16cb8705 (diff) |
Use DelayedOperation on Android.
BUGZ
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same/VariableTestActivity.java')
-rw-r--r-- | same-android/src/main/java/com/orbekk/same/VariableTestActivity.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java b/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java index ba33058..1fffbad 100644 --- a/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java +++ b/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java @@ -11,6 +11,7 @@ import android.widget.TextView; import android.widget.Toast; import com.orbekk.same.android.ClientInterfaceBridge; +import com.orbekk.util.DelayedOperation; public class VariableTestActivity extends Activity { private Logger logger = LoggerFactory.getLogger(getClass()); @@ -36,12 +37,13 @@ public class VariableTestActivity extends Activity { public void setVariable(View unused) { EditText et = (EditText)findViewById(R.id.set_variable_text); String newValue = et.getText().toString(); - try { - variable.set(newValue); - } catch (UpdateConflict e) { - Toast.makeText(this, "Failed to update.", Toast.LENGTH_SHORT) + logger.info("Setting variable."); + DelayedOperation op = variable.set(newValue); + logger.info("Waiting for delayed operation."); + if (!op.getStatus().isOk()) { + Toast.makeText(this, "Failed to update: " + op.getStatus(), + Toast.LENGTH_SHORT) .show(); - e.printStackTrace(); } } |