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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to