On Tue, Jun 22, 2010 at 3:55 PM, Jeruliu <[email protected]> wrote: > Hi, I can managed to autostart my activiy when reboot. > > But however I realized that what should i autostart is not the activiy > with UI but a one time function call in background. > > I used to define the receiver in manifest xml to autostart the > activity, this is working good. > <receiver android:enabled="true" android:name=".BootUpReceiver" > android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> > <intent-filter> > <action android:name="android.intent.action.BOOT_COMPLETED" /> > <category android:name="android.intent.category.DEFAULT" /> > </intent-filter> > </receiver> > > Say my application has the main acticity class A as entry point and > another class B with just a funtion called fireSomeAction. > > Now after android reboot, i want to call the fireSomeAction function > in class B for only once, how can i do that?
Move fireSomeAction() into BootUpReceiver and call it from there. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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

