Ejemplo n.º 1
0
 public void onDiscoveryStateChanged(CalibreService.DiscoveryState discoveryState) {
   ConnectionFragment frag = (ConnectionFragment) tab_connection.getFragment();
   if (frag != null) {
     frag.setDiscoveryState(discoveryState);
     switch (discoveryState) {
       case NO_SERVER:
         if (frag.isResumed() && mFragmentManager.findFragmentByTag("dlg-connect") == null) {
           NoServerDialogFragment instNSDF = new NoServerDialogFragment();
           instNSDF.show(mFragmentManager, "dlg-no-server");
         }
         break;
     }
   }
 }
Ejemplo n.º 2
0
 private void PasarAlFragment() {
   connectionFragment = new ConnectionFragment();
   connectionFragment.GetAdapter(btAdapter);
   FragmentTransaction transaction = getFragmentManager().beginTransaction();
   transaction.add(R.id.Layout, connectionFragment);
   transaction.addToBackStack(null);
   transaction.commit();
 }
Ejemplo n.º 3
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.next_Icon:
       if (connectionFragment.sockets.size() != 0) {
         connectionFragment.PasarALosGraficos();
         item.setVisible(false);
       } else {
         Toast.makeText(this, getString(R.string.no_sensors), Toast.LENGTH_SHORT).show();
       }
       break;
   }
   return super.onOptionsItemSelected(item);
 }
Ejemplo n.º 4
0
 @Override
 public void onErrorReported(CalibreService.ErrorType e) {
   ConnectionFragment frag = (ConnectionFragment) tab_connection.getFragment();
   if (frag != null) frag.setErrorMessage(e);
 }
Ejemplo n.º 5
0
 public void onConnectionStateChanged(CalibreService.ConnectionState connectionState) {
   ConnectionFragment frag = (ConnectionFragment) tab_connection.getFragment();
   if (frag != null) frag.setConnectionState(connectionState);
 }