project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/NetplayService.java
changeset 7346 b0f67c5b4215
parent 7332 3f2e130f9715
child 7349 12fdfd2038d4
equal deleted inserted replaced
7344:25b8906f901a 7346:b0f67c5b4215
    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 {