Hi,
Sure, there is a way. Android broadcasts a special intent action once
booting is completed.
In your manifest:
1. Add a permission to receive the event:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
2. Declare a broadcast receiver:
<receiver android:name="your receiver name here"
android:label="@string/boot_receiver_name">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
3. In the receiver's onReceive method, check the action and do what's
needed:
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action != null && action.equals(Intent.ACTION_BOOT_COMPLETED)) {
/*
* Boot completed, start the activity
*/
}
}
-- Kostya
14.06.2010 14:43, CMF пишет:
hi all, is there any one know how to open an App when the Android OS
start up, I have to do it in an embedded system?
--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
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