Exemple #1
0
 @Override
 public void onPause() {
   if (socket != null) {
     socket.close();
     socket = null;
   }
   super.onPause();
   if (Integer.parseInt(Build.VERSION.SDK) >= 5 && Integer.parseInt(Build.VERSION.SDK) <= 7)
     reenableKeyguard();
 }
 /** Stops media application */
 public boolean stopMedia() {
   printLog("halting java audio..", LogLevel.HIGH);
   if (sender != null) {
     sender.halt();
     sender = null;
     printLog("sender halted", LogLevel.LOW);
   }
   if (receiver != null) {
     receiver.halt();
     receiver = null;
     printLog("receiver halted", LogLevel.LOW);
   }
   if (socket != null) socket.close();
   return true;
 }