Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Pododroid extends Activity{
- .....
- private PasoService mServicio;
- private ServiceConnection mConection = new ServiceConnection();
- public class ServiceConnection{
- public void onServiceConnected(ComponentName className, IBinder service) {
- mServicio = ((PasoService.PasoBinder)service).getService();
- mServicio.registerCallback(mCallback);
- mServicio.actualizaPreferencias();
- }
- public void onServiceDisconnected(ComponentName className) {
- mServicio = null;
- }
- }
- // AQUI ME SALE ERROR
- // Enlaza la clase con el servicio(creando el servicio si existe la conexion)
- private void bindPasoService() {
- Log.i(TAG, "[SERVICE] Bind");
- bindService(new Intent(Pododroid.this, PasoService.class),
- mConection,
- Context.BIND_AUTO_CREATE + Context.BIND_DEBUG_UNBIND);
- }
- // Desconecta la clase con el servicio
- private void unbindPasoService() {
- Log.i(TAG, "[SERVICE] Unbind");
- unbindService(mConection);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement