Hi All

Not working my recever why ?

here my code please help me

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

public class MyRecever extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {


       int level = intent.getIntExtra("level", 0);
       Log.i("MyRecever", "--->>"+level);


    }

}
====manifest.xml===

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
    package="my.custom"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY"/>
    <uses-permission android:name="android.permission.BATTERY_STATS"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".CustomserviceActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name="MyRecever"
            android:enabled="true"
             android:permission="android.permission.BROADCAST_STICKY">
            <intent-filter>
                <action
android:name="android.intent.action.BATTERY_CHANGED"/>
            </intent-filter>
        </receiver>
    </application>

</manifest>

-- 
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