summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com/orbekk/SameControllerActivity.java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-13 20:15:39 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-13 20:15:39 +0100
commit5bc18853d378e8d6c6f965a3e16f1c388cfb8210 (patch)
tree82cb2a9e8adcb331251bd81811cb068a317d07f3 /same-android/src/main/java/com/orbekk/SameControllerActivity.java
parent5190cf7a9b1db1ef0d7cac007ce73aff248203f0 (diff)
Display discovered networks in user interface.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/SameControllerActivity.java')
-rw-r--r--same-android/src/main/java/com/orbekk/SameControllerActivity.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/same-android/src/main/java/com/orbekk/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/SameControllerActivity.java
index a2d5688..4fb1424 100644
--- a/same-android/src/main/java/com/orbekk/SameControllerActivity.java
+++ b/same-android/src/main/java/com/orbekk/SameControllerActivity.java
@@ -49,8 +49,10 @@ public class SameControllerActivity extends Activity {
if (SameService.AVAILABLE_NETWORKS_UPDATE.equals(intent.getAction())) {
ArrayList<String> networkList = intent.getStringArrayListExtra(
SameService.AVAILABLE_NETWORKS);
- Toast.makeText(SameControllerActivity.this, networkList.toString(),
- Toast.LENGTH_SHORT).show();
+ ListView list = (ListView)findViewById(R.id.network_list);
+ list.setAdapter(new ArrayAdapter<String>(
+ SameControllerActivity.this,
+ R.layout.list_text_item, networkList));
}
}
};
@@ -89,15 +91,6 @@ public class SameControllerActivity extends Activity {
public void searchNetworks(View unused) {
logger.info("SearchNetworks()");
-// Toast.makeText(this, "Discovering networks", Toast.LENGTH_SHORT).show();
-// final String[] listItems = new String[]{"First item", "Second item"};
-// ListView list = (ListView)findViewById(R.id.network_list);
-// list.setAdapter(new ArrayAdapter<String>(this, R.layout.list_text_item,
-// listItems));
-
-// Message message = Message.obtain(null, SameService.DISPLAY_MESSAGE,
-// "Message from Activity!");
-
Message searchMessage = Message.obtain(null, SameService.SEARCH_NETWORKS);
try {
sameService.send(searchMessage);