You put the <receiver> outside of the <application>.  It should be inside,
like all of the other component definitions.

On Tue, Aug 18, 2009 at 8:17 PM, Honest <[email protected]> wrote:

>
> my xml file is as below. Let me know if there is any thing wrong in
> it.
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>      package="com.saltriver.service"
>      android:versionCode="1"
>      android:versionName="1.0">
>    <application android:icon="@drawable/icon" android:label="@string/
> app_name">
>        <activity android:name=".ServiceExample"
>                  android:label="@string/app_name">
>            <intent-filter>
>                <action android:name="android.intent.action.MAIN" />
>                <category
> android:name="android.intent.category.LAUNCHER" />
>            </intent-filter>
>        </activity>
>
>        <service android:name=".MyService"></service>
>
>    </application>
>
>    <receiver android:name=".yourReceiver" android:enabled="true">
>     <intent-filter>
>    <action android:name="android.intent.action.BOOT_COMPLETED" />
>   </intent-filter>
>  </receiver>
>
>    <uses-sdk android:minSdkVersion="3" />
>        <uses-permission
> android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-
> permission>
>
> </manifest>
>
> On Aug 18, 9:17 pm, Dianne Hackborn <[email protected]> wrote:
> > you haven't included your complete manifest, but it looks like you have
> put
> > the uses-permission at the same level is receiver; uses-permission should
> be
> > an immediate child of manifest.
> >
> >
> >
> >
> >
> > On Tue, Aug 18, 2009 at 4:56 AM, Honest <[email protected]> wrote:
> >
> > > I want to start application when phone starts and want to hide it from
> > > the user so i did in following way. The follinng is broadcast code.
> >
> > > public class yourReceiver extends BroadcastReceiver {
> > >  //  @Override
> > >    public void onReceive(Context context, Intent intent) {
> > >        /*
> > >        Intent i = new Intent(MyService.);
> > >        i.setClass(context, MyService.class);
> > >        context.startService(i);
> > >        */
> >
> > >        Log.e("in broadcast", "in broadcast");
> > >                context.startService(new Intent(context,
> MyService.class));
> >
> > >    }
> > > }
> >
> > > I also add following to the xml file.
> >
> > > <receiver android:name=".yourReceiver" >
> > >    <intent-filter>
> > >    <action android:name="android.intent.action.BOOT_COMPLETED" />
> > >   </intent-filter>
> > >  </receiver>
> >
> > >    <uses-sdk android:minSdkVersion="3" />
> > >        <uses-permission
> > > android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-
> > > permission>
> >
> > > But when phone starts it seems nothing is happening. It is nto
> > > invoking that broadcast. Can some one tell me that could be wrong in
> > > it ?
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > [email protected]
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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