Hi,

I'm trying to create a broadcast receiver which responds to system
events and change system settings.  I don't need any interaction from
the user so I don't need an activity and have been trying to do
everything through the manifest file.  I've put a log event into my
onReceive method but it never logs anything so I'm presuming my method
is never called.  I've tried this with both the 1.5 and 1.6 SDKs.  I
was hoping somebody could have a look at my code please and let me
know if there are any problems.

Manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="uk.co.richarth"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">


    <receiver
android:permission="android.permission.ACCESS_NETWORK_STATE"
android:enabled="true" android:name=".BroadcastReceiverExample">
    <intent-filter>
    <action
android:name="android.intent.action.AIRPLANE_MODE_CHANGED"></action>
    </intent-filter>
    </receiver>
</application>
    <uses-sdk android:minSdkVersion="2" />

<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"></uses-
permission>

</manifest>

Class

package uk.co.richarth;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BroadcastReceiverExample extends BroadcastReceiver {

        @Override
        public void onReceive(Context arg0, Intent arg1) {
                Log.d("debug", "working");

        }

}

Thanks for the help

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to