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; } } }
private void PasarAlFragment() { connectionFragment = new ConnectionFragment(); connectionFragment.GetAdapter(btAdapter); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.add(R.id.Layout, connectionFragment); transaction.addToBackStack(null); transaction.commit(); }
@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); }
@Override public void onErrorReported(CalibreService.ErrorType e) { ConnectionFragment frag = (ConnectionFragment) tab_connection.getFragment(); if (frag != null) frag.setErrorMessage(e); }
public void onConnectionStateChanged(CalibreService.ConnectionState connectionState) { ConnectionFragment frag = (ConnectionFragment) tab_connection.getFragment(); if (frag != null) frag.setConnectionState(connectionState); }