Hi Douglas.

http://developer.android.com/guide/topics/manifest/receiver-element.html#nm

In the Manifest you write that your receiver class is called
Receiver .. and
later you call the class NoteReceiver ??

But nevertheless I have my doubts that you have your public class
NoteReceiver in
a file "Receiver".

Good luck ! Frank



On 8 Dez., 03:33, Douglas Fonseca <[email protected]> wrote:
> Hi,
> I'm developing an app that needs to start when the phone is power plugged.
> To do so, I used this code in manifest file
>
> <application android:icon="@drawable/icon" android:label="@string/app_name">
>         <activity android:name=".Activity"
>                   android:label="@string/app_name">
>             <intent-filter>
>                 <action android:name="android.intent.action.MAIN" />
>                 <category android:name="android.intent.category.LAUNCHER" />
>             </intent-filter>
>         </activity>
> <activity android:name=".Activity2"
>  android:label="@string/app_name" />
> <reciever android:name=".Receiver">
>        <intent-filter>
>                <action
> android:name="android.intent.action.ACTION_POWER_CONNECTED" />
>        </intent-filter>
> </reciever>
>     </application>
>
> In Receiver file:
>
> public class NoteReceiver extends BroadcastReceiver
> {
> @Override
> public void onReceive(Context context, Intent intent)
> {
> context.startActivity(new Intent(context,Activity2.class));
>
> }
> }
>
> This code was suposed to start the Activity2 Activity, but it's not working!
> Does someone know that's wrong?
> Thanks,
> ---------------------------------------------------
> Douglas Fonseca
> Engenharia da Computação 2010
> Universidade Estadual de Campinas

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