Android BOOT_COMPLETED无法正常工作!

时间:2011-01-20 10:00:51

标签: android htc-hero

这是我创建的一个简单程序,用于测试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> 

的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");
     }
}

1 个答案:

答案 0 :(得分:2)

我不确定这是否重要,但请尝试将<Intent-filter>更改为<intent-filter>(注意小写'我')。