summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java')
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
index 6e8d613..c0f60f8 100644
--- a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
+++ b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
@@ -63,8 +63,7 @@ public class SameControllerActivity extends Activity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String networkName = networkNames.get(position);
- int networkIndex = networkNames.indexOf(networkName);
- String masterUrl = networkUrls.get(networkIndex);
+ String masterUrl = networkUrls.get(position);
joinNetwork(masterUrl);
}
};
@@ -87,6 +86,16 @@ public class SameControllerActivity extends Activity {
}
}
+ public void killMaster(View unused) {
+ Message message = Message.obtain(null, SameService.KILL_MASTER);
+ try {
+ sameService.send(message);
+ } catch (RemoteException e) {
+ logger.error("Failed to kill master", e);
+ throw new RuntimeException(e);
+ }
+ }
+
public void joinNetworkUrl(View unused) {
Intent intent = new Intent(this, SameService.class);
intent.setAction("join");