简体   繁体   中英

How to call on destroy() method without being called onPause & onStop

我想调用onDestroy()方法而不调用onCreate()方法之外的其他生命周期方法。

You need to call finish() in your onCreate() method

void finish ()

Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult() .

你必须在onCreate()调用finish() onCreate()

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