]> git.zerfleddert.de Git - ms2-fixes/commitdiff
run at boot time
authorMichael Gernoth <michael@gernoth.net>
Fri, 20 May 2011 18:45:12 +0000 (20:45 +0200)
committerMichael Gernoth <michael@gernoth.net>
Fri, 20 May 2011 18:45:12 +0000 (20:45 +0200)
MS2Debounce/AndroidManifest.xml
MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java [new file with mode: 0644]

index ddbbbb3dcfe681e9cbc2f3c6cb9d5e47d6df6223..7f9b4727c7ad1c9169dc0bf22040c5b5456201fe 100644 (file)
             </intent-filter>
         </activity>
        <service android:name=".DebounceService"/>
+       <receiver android:name=".DebounceBootReceiver">
+               <intent-filter>
+                       <action android:name="android.intent.action.BOOT_COMPLETED" />
+                       <category android:name="android.intent.category.HOME" />
+               </intent-filter>
+       </receiver>
     </application>
 </manifest> 
diff --git a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
new file mode 100644 (file)
index 0000000..2f97c2c
--- /dev/null
@@ -0,0 +1,15 @@
+package de.rmdir.ms2debounce;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class DebounceBootReceiver extends BroadcastReceiver{
+       @Override
+       public void onReceive(Context context, Intent intent) {
+               if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
+                       Intent debouncesvc = new Intent(context, DebounceService.class);
+                       context.startService(debouncesvc);
+               }
+       }
+}
Impressum, Datenschutz