From 690190850e0cf168a92940711cea6fe1eb500266 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 1 Aug 2014 23:21:37 +0200 Subject: [PATCH] Start automatically on boot (closes #54). --- src/main/AndroidManifest.xml | 6 ++++++ .../syncthingandroid/syncthing/BootReceiver.java | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/main/java/com/nutomic/syncthingandroid/syncthing/BootReceiver.java diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 6ebd437f..d6b50bca 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ + + + + + + diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/BootReceiver.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/BootReceiver.java new file mode 100644 index 00000000..82769616 --- /dev/null +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/BootReceiver.java @@ -0,0 +1,12 @@ +package com.nutomic.syncthingandroid.syncthing; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class BootReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + context.startService(new Intent(context, SyncthingService.class)); + } +}