开发者

android emulating a reboot

I have coded a BroadcastReceiver to enable the resetting of an alarm if a user has to reboot hid device. Is there any way to开发者_JAVA技巧 test this in the emulator, in other words what sequence of events are required to cause the emulator to kick off the BroadcastReceiver . Ron


I have not tried it yet, but Dianne Hackborn wrote the following yesterday:

You can also use "adb shell am" to send a BOOT_COMPLETED broadcast to your app for quick testing. I can't remember the exact syntax, but "am help" will tell you. Be sure to specific your explicit component name when doing this, or you will cause all installed apps to re-run their boot completed receivers, which may not be fun. :)


I believe that the only way to do it will be to close the emulation window and start it again. If you are running Eclipse, simply close the emulator and then run/debug your project to start it again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜