Activity.finish():將Activity移出線,其還占用資源沒有被釋放,所以按手機"back"按鍵的時候,也找不到這個Activity。
Activity.onDestory():為Activity的生命周期中,之最后一步,釋放其資源,故要重新進入此Activity的時候,必須重創建,執行onCreate()方法。
System.exit(0):將Application退出整個用程序。
2017年11月11日 星期六
Android Studio:finish()、onDestory()、System.exit(0)的區別
Related Posts:
Android Studio:按鈕樣式(Button Style)設計!-- 【Android】設計自己的按鈕外觀 http://oldgrayduck.blogspot.tw/2012/10/android.html 【Android】修改按鈕樣式(Button Style),圓角按鈕 http://learnexp.tw/%E3%80%90android%E3%80%91%E4%BF%AE%E6%94%B9%E6%8C%89%E9%88%95%E6%A8%A3%E5%BC%8Fbutton-style%EF%… Read More
Android Studio:多重按鈕事件!-- [Android] 多重按鈕事件 http://xken831.pixnet.net/blog/post/459993764-%5Bandroid%5D-%E5%A4%9A%E9%87%8D%E6%8C%89%E9%88%95%E4%BA%8B%E4%BB%B6 [Android]簡易模組化設計(利用單一Button及多個Button來說明) http://blog.xuite.net/viplab/blog/208667642-%5B… Read More
Android Studio:Android Studio 安裝 下載Android Studio免安裝版(no android SDK,no installer)網址: https://developer.android.com/studi... ps.下載Android Studio的免安裝版,才可放在隨身碟移動工作。 解壓縮檔後,另新增一個”SDK”檔名的資料夾在旁,做為下載SDK儲存的位置。 下載檔案與講義連結: goo.gl/8Tqq39 模擬器-AVD Manager h… Read More
Android Studio:更改的專案名稱!-- Android Studio 如何更改 Package Name ? https://tedliou.com/archives/android-studio-howto-change-package-name/ 徹底修改Android 套件、應用程式ID、專案名稱 http://xanxusvervr.blogspot.tw/2016/06/android-id.html -- 改成新的專案名稱,有關的地方: 專案資料夾 套件名… Read More
Android Studio:對話視窗/AlertDialog!-- Jollen 的 Android 教學,#14: 什麼是對話盒 (Dialog)?如何建立對話盒? http://www.jollen.org/blog/2009/06/jollen-android-programming-14.html Android AlertDialog 教學(上) http://toimy.blogspot.tw/2010/08/android-alertdialog.html Hello World 進階了… Read More
0 意見:
張貼留言