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

什么是“已保存實(shí)例狀態(tài)"?

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

問(wèn)題描述

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

這篇關(guān)于什么是“已保存實(shí)例狀態(tài)"?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

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 存儲(chǔ)桶身份驗(yàn)證錯(cuò)誤)
admob 6.2.1 nullpointer exception(admob 6.2.1 空指針異常)
How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中設(shè)置 SDK?)
My phone cannot be detected in eclipse to test run(eclipse 無(wú)法檢測(cè)到我的手機(jī)進(jìn)行試運(yùn)行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 经典三级av | 中文字幕在线免费 | 狠狠五月天| 婷色 | 丁香五香天堂网 | 一区二区黄色 | 成人免费看片 | 一区二区三区视频在线 | 久久精品一区二区三区不卡牛牛 | 九九成人| 亚洲精品久久久久avwww潮水 | 免费一级黄色片 | 国语对白做受欧美 | 亚洲无av在线中文字幕 | 国产精品一区在线观看 | 五月久久| 久久久久久国产精品 | 成人免费视频国产免费麻豆 | 欧美日韩免费 | 精品国产一区二 | 中文字幕免费av | 手机av片| 亚洲一区二区在线 | 91久久奴性调教 | 精品一区视频 | 色哟哟一区二区 | 色综合久久久 | 久久久久亚洲 | 黑人一级黄色片 | 91精品国产色综合久久不卡98 | 欧美一级片免费 | 青青伊人网 | 国产欧美日韩一区二区三区 | 麻豆av免费观看 | 青青草久久 | 国产一级免费观看 | www.草| www黄色| a视频在线观看 | 国产激情久久久 | 天天综合天天做天天综合 |