XmppConnectionService.java

 1package de.gultsch.chat.services;
 2
 3import android.app.Service;
 4import android.content.Intent;
 5import android.os.Binder;
 6import android.os.IBinder;
 7
 8public class XmppConnectionService extends Service {
 9
10	// Binder given to clients
11    private final IBinder mBinder = new XmppConnectionBinder();
12
13    /**
14     * Class used for the client Binder.  Because we know this service always
15     * runs in the same process as its clients, we don't need to deal with IPC.
16     */
17    public class XmppConnectionBinder extends Binder {
18        XmppConnectionService getService() {
19            // Return this instance of LocalService so clients can call public methods
20            return XmppConnectionService.this;
21        }
22    }
23
24    @Override
25    public IBinder onBind(Intent intent) {
26        return mBinder;
27    }
28
29}