Esempio n. 1
0
 @Override
 protected void onStop() {
   super.onStop();
   if (udpSenderService != null && !udpSenderService.isRunning())
     stopService(new Intent(this, UdpSenderService.class));
   save();
 }
Esempio n. 2
0
  public void error(final String text) {
    final Activity activity = this;

    new AlertDialog.Builder(activity)
        .setTitle("Error")
        .setMessage(text)
        .setNeutralButton("OK", null)
        .show();
    if (udpSenderService != null) {
      udpSenderService.stop();
      start.setChecked(false);
      txtIp.setEnabled(true);
      txtPort.setEnabled(true);
      chkSendOrientation.setEnabled(true);
      chkSendRaw.setEnabled(true);
    }
  }
Esempio n. 3
0
 @Override
 public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
   udpSenderService = ((UdpSenderService.MyBinder) iBinder).getService();
   start.setChecked(udpSenderService.isRunning());
 }