project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java
branchhedgeroid
changeset 15533 fb23e49b2d4e
parent 10017 de822cd3df3a
equal deleted inserted replaced
15532:7030706266df 15533:fb23e49b2d4e
   101     protected void onPause() {
   101     protected void onPause() {
   102         super.onPause();
   102         super.onPause();
   103         broadcastManager.unregisterReceiver(connectedReceiver);
   103         broadcastManager.unregisterReceiver(connectedReceiver);
   104         broadcastManager.unregisterReceiver(connectionFailedReceiver);
   104         broadcastManager.unregisterReceiver(connectionFailedReceiver);
   105         broadcastManager.unregisterReceiver(passwordRequestedReceiver);
   105         broadcastManager.unregisterReceiver(passwordRequestedReceiver);
   106         Netplay netplay = Netplay.getAppInstance(getApplicationContext());
   106         // disable netplay for now
   107         if(netplay.getState() == State.CONNECTING) {
   107         if (Netplay.hasAppInstance()) {
   108             netplay.disconnect();
   108             Netplay netplay = Netplay.getAppInstance(getApplicationContext());
   109         }
   109             if(netplay.getState() == State.CONNECTING) {
       
   110                 netplay.disconnect();
       
   111             }
       
   112         }
       
   113 
   110     }
   114     }
   111 
   115 
   112     @Override
   116     @Override
   113     public boolean onCreateOptionsMenu(Menu menu) {
   117     public boolean onCreateOptionsMenu(Menu menu) {
   114         super.onCreateOptionsMenu(menu);
   118         super.onCreateOptionsMenu(menu);