I am trying to listen for a reboot event.
I'v created the following class:
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class OnBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.i("MYBOOTRECEIVER", "HELLO!"); } }
and then in the manifest file I put the following xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mypackage" android:installLocation="internalOnly" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <application android:label="@string/app_name" > <receiver android:name=".OnBootReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.QUICKBOOT_POWERON" /> <category android:name="android.intent.category.HOME" /> </intent-filter> </receiver> </application> </manifest>
However, after I installed this application and rebooted the device, nothing happens. (I use the Galaxy Tab 8.9 with Android 3.2 on it). As you can see from the manifest, I installed the application in internal memory (for example, suggested on similar issues here in stackoverflow) ... I also added the Quickboot_poweron action (to see if the galaxy tab has the same behavior for htc devices) ... but nothing. I hope someone can help me!
source share