@Override protected void onResume() { super.onResume(); IntentFilter filter = new IntentFilter(Constantes.FILTER_GCM.CHOFER); filter.setPriority(2); registerReceiver(receptor, filter); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_turno); boton = (Button) findViewById(R.id.botonAccionTurno); labelHoraInicio = (TextView) findViewById(R.id.labelHoraInicio); labelMovil = (TextView) findViewById(R.id.labelMovil); labelPatente = (TextView) findViewById(R.id.labelPatente); switchDisponible = (Switch) findViewById(R.id.switchDisponible); receptor = new ReceptorSolicitud(); new ActualizarTurno().execute(); actualizar(); Log.i("LOG", "Llamando a servicio..."); Intent intent = new Intent(TurnoActivity.this, ActualizacionPuntoService.class); startService(intent); }
@Override protected void onPause() { super.onPause(); unregisterReceiver(receptor); }