简体   繁体   中英

How to initiate an action when shutting down the emulator in Android Studio?

I want to make an action that occurs when I shutdown the emulator. More specifically I want to write to a file before the emulator shuts down.

Try registering a BroadCastReceiver for https://developer.android.com/reference/android/content/Intent#ACTION_SHUTDOWN intent. You might need a Service or Activity running to receive it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM