Android BOOT_COMPLETED 不工作!
这是我创建的一个简单程序,用于测试 Android 的 BOOT_COMPLETED 事件,但它不起作用!我在这里做错了什么吗?
<?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>
爪哇:
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");
}
}
This is a simple program i created to test BOOT_COMPLETED event of Android but it's not working! 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:
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");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这是否重要,但尝试将
更改为
(注意小写“i”)。I'm not sure if it matters, but try changing
<Intent-filter>
to<intent-filter>
(note lowercase 'i').