久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

什么是“已保存實例狀態"?

What is #39;savedInstanceState#39;?(什么是“已保存實例狀態?)
本文介紹了什么是“已保存實例狀態"?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

I am new to Android Development but I have some knowledge of OOP concepts. I am trying to learn Android from Java perspective.

I understand that savedInstanceState inside onCreate() on line 9 is the declaration of Bundle class. On line 10 we are calling the onCreate() method from the super class.

Here is what I don't unterstand: On line 10 we pass savedInstanceState itself as a parameter to the onCreate() method. This doesn't make sense to me as I would expect to pass an object which is of the Bundle type, but instead of that we pass a reference not an object of type Bundle to the method.

解決方案

The savedInstanceState is a reference to a Bundle object that is passed into the onCreate method of every Android Activity.

The onCreate() expects to be called with a Bundle as parameter so we pass savedInstanceState.

Activities have the ability, under special circumstances, to restore themselves to a previous state using the data stored in this bundle. If there is no available instance data, the savedInstanceState will be null.

For example, the savedInstanceState will always be null the first time an Activity is started, but may be non-null if an Activity is destroyed during rotation, because onCreate is called each time activity starts or restarts.

Hope it helps

這篇關于什么是“已保存實例狀態"?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why would you choose Android API over Google APIs in the SDK on Eclipse?(為什么在 Eclipse 的 SDK 中選擇 Android API 而不是 Google API?)
Couchbase Bucket authentication error(Couchbase 存儲桶身份驗證錯誤)
admob 6.2.1 nullpointer exception(admob 6.2.1 空指針異常)
How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中設置 SDK?)
My phone cannot be detected in eclipse to test run(eclipse 無法檢測到我的手機進行試運行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 国产精品不卡一区二区三区 | 九色一区 | 欧美日韩国产一区二区三区 | 欧美日韩一区二区在线 | 日韩精品av一区二区三区 | 国产一区二区三区久久久久久久久 | 精品视频一区二区三区 | 亚洲一区二区久久 | 久久性| 亚洲成人免费视频 | 国产一区二区三区免费观看在线 | av手机在线 | 亚洲一区二区三区在线播放 | 孰女乱色一区二区三区 | 午夜在线精品偷拍 | 中文字幕国产精品 | 欧洲免费毛片 | 欧美三级在线 | 亚洲欧美国产毛片在线 | 久久久久久久久久久成人 | 国产精品视频在线观看 | 91av视频 | 国产在线一区二区 | 亚洲精品在线免费播放 | 国产aa | 性一交一乱一透一a级 | 国产精品一区二区不卡 | www.操.com | av毛片| 国产精品免费小视频 | 欧美日韩在线精品 | 亚洲日本乱码在线观看 | 99视频在线免费观看 | 国产美女视频黄a视频免费 国产精品福利视频 | 亚洲 欧美 另类 综合 偷拍 | 国产精品久久久久aaaa | 免费在线一区二区三区 | 99pao成人国产永久免费视频 | 天天干在线播放 | 亚洲精品国产成人 | 久久久精品一区二区 |