project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/NetplayService.java
equal
deleted
inserted
replaced
25 } |
25 } |
26 try { |
26 try { |
27 netconn = new Netconn(getApplicationContext(), "AndroidTester"); |
27 netconn = new Netconn(getApplicationContext(), "AndroidTester"); |
28 } catch (IOException e) { |
28 } catch (IOException e) { |
29 // TODO better handling |
29 // TODO better handling |
30 throw new RuntimeException("Unable to start frontlib"); |
30 throw new RuntimeException("Unable to start frontlib", e); |
31 } |
31 } |
32 timer = new CountDownTimer(Long.MAX_VALUE, 50) { |
32 timer = new CountDownTimer(Long.MAX_VALUE, 50) { |
33 @Override |
33 @Override |
34 public void onTick(long millisUntilFinished) { |
34 public void onTick(long millisUntilFinished) { |
35 if(netconn != null) { |
35 if(netconn != null) { |
44 timer.start(); |
44 timer.start(); |
45 } |
45 } |
46 |
46 |
47 @Override |
47 @Override |
48 public void onDestroy() { |
48 public void onDestroy() { |
|
49 timer.cancel(); |
49 netconn.disconnect(); |
50 netconn.disconnect(); |
50 Flib.INSTANCE.flib_quit(); |
51 Flib.INSTANCE.flib_quit(); |
51 } |
52 } |
52 |
53 |
53 public class NetplayBinder extends Binder { |
54 public class NetplayBinder extends Binder { |