diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-28 15:08:58 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-28 15:08:58 +0100 |
commit | dbb86148a7b53d729085b4ace612e211d7a876ed (patch) | |
tree | 95e8542f0996dd2a7d9e4c92c6330b4ed124594e /same-android/src/main/java/com/orbekk/same | |
parent | e5418063a31eec06835f294ec6e1054ea42f846d (diff) |
Add support for more than one listener to variables.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same')
-rw-r--r-- | same-android/src/main/java/com/orbekk/same/VariableTestActivity.java | 3 |
1 files changed, 2 insertions, 1 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 b667d3a..46adb88 100644 --- a/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java +++ b/same-android/src/main/java/com/orbekk/same/VariableTestActivity.java @@ -68,13 +68,14 @@ public class VariableTestActivity extends Activity { client.connect(); variable = client.createVariableFactory() .createString("TestVariable"); - variable.setOnChangeListener(onChangeListener); + variable.addOnChangeListener(onChangeListener); variable.set("Hello, World!"); displayVariable(); } @Override public void onStop() { super.onStop(); + variable.removeOnChangeListener(onChangeListener); client.disconnect(); } } |