What error message do you get? - Moazzam http://moazzam-khan.com/
On Jan 14, 12:55 pm, Massimo Barbera <[email protected]> wrote: > Dear all, > I have been following the examples for developing a Broadcast Receiver > to catch the boot complete. > > Though it looks like I have just copied and pasted the code of the > existing working examples, it looks like mine is not working. > > Here is my code: if placing a breakpoint at the "if" and starting the > emulator in debug mode, the breakpoint is never reached. > > Could you please help? Thanks! > > ----------------------------------------------------------------------------------------------------------------------------------------------- > My code: > > public class StartUpReceiver extends BroadcastReceiver{ > > private final static String TAG = "StartUpReceiver"; > > @Override > public void onReceive(Context context, Intent intent) { > > Log.d(TAG, "enter"); > /* Checks if Service is enabled and starts the Service > accordingly */ > if( "android.intent.action.BOOT_COMPLETED".equals > (intent.getAction())){ > > //Do something > > } > > ----------------------------------------------------------------------------------------------------------------------------------------------- > My manifest: > > <?xml version="1.0" encoding="utf-8"?> > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > package="com.feelsafe.com" android:versionCode="1" > android:versionName="1.0.0"> > > <uses-permission > android:name="android.permission.RECEIVE_BOOT_COMPLETED" ></uses- > permission> > <uses-permission > android:name="android.permission.ACCESS_COARSE_LOCATION"></uses- > permission> > <uses-permission > android:name="android.permission.ACCESS_FINE_LOCATION"></uses- > permission> > <uses-permission android:name="android.permission.INTERNET"></uses- > permission> > > <application android:label="@string/app_name" > android:icon="@drawable/myicon"> > > <activity android:name=".MyActivity" 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=".StartUpReceiver" > android:enabled="true" > > <intent-filter> > <action android:name="android.intent.action.BOOT_COMPLETED" /> > <category android:name="android.intent.category.HOME" /> > </intent-filter> > </receiver> > > <activity android:name="Class1"></activity> > <activity android:name="Class2"></activity> > > <service android:name="MyService"></service> > > </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 -~----------~----~----~----~------~----~------~--~---

