diff options
Diffstat (limited to 'src/eu/siacs/conversations')
-rw-r--r-- | src/eu/siacs/conversations/services/EventReceiver.java | 17 | ||||
-rw-r--r-- | src/eu/siacs/conversations/ui/XmppActivity.java | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/services/EventReceiver.java b/src/eu/siacs/conversations/services/EventReceiver.java new file mode 100644 index 00000000..41e31114 --- /dev/null +++ b/src/eu/siacs/conversations/services/EventReceiver.java @@ -0,0 +1,17 @@ +package eu.siacs.conversations.services; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class EventReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + Intent mIntentForService = new Intent(context, XmppConnectionService.class); + if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { + + } + context.startService(mIntentForService); + } + +} diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index a2951c65..c1b64f22 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -37,9 +37,9 @@ public abstract class XmppActivity extends Activity { @Override protected void onStart() { - startService(new Intent(this, XmppConnectionService.class)); super.onStart(); if (!xmppConnectionServiceBound) { + startService(new Intent(this, XmppConnectionService.class)); Intent intent = new Intent(this, XmppConnectionService.class); bindService(intent, mConnection, Context.BIND_AUTO_CREATE); } |