Sending a running application to background programmatically

前端 未结 4 752
礼貌的吻别
礼貌的吻别 2020-12-16 18:50

Is it possible to send a activity into background programmatically in android?

I am creating a prank application that plays funny sounds after a specified time (inpu

4条回答
  •  渐次进展
    2020-12-16 19:01

    To expand on the answer by @ns476, the reason you should play it from a service is that any Activity that is no longer in the foreground can be killed at any time by the OS. Please review the activity lifecycle.

提交回复
热议问题