[英]Android BOOT_COMPLETED not working!
This is a simple program i created to test BOOT_COMPLETED event of Android but it's not working! 这是我创建的一个简单程序,用于测试Android的BOOT_COMPLETED事件,但无法正常工作! am i doing something wrong here? 我在这里做错什么了吗?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.enea.training.bootdemo"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<receiver android:name=".BootDemoReceiver">
<Intent-filter>
<action android:name ="android.intent.action.BOOT_COMPLETED"></action>
</Intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
java: Java的
public class BootDemoReceiver extends BroadcastReceiver {
static final String TAG = "BootDemoReceiver";
@Override
public void onReceive(final Context context, final Intent bootintent) {
Log.v(TAG, "Come on");
}
}
我不确定是否重要,但是请尝试将<Intent-filter>
更改为<intent-filter>
(注意小写的“ i”)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.