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

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

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

問題描述

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)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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 無法檢測(cè)到我的手機(jī)進(jìn)行試運(yùn)行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 国产午夜精品一区二区三区嫩草 | 欧美一区二区三区在线看 | 天天操天天摸天天干 | 99这里只有精品视频 | 欧美成人精品一区二区男人看 | 中文字幕一区二区视频 | 国产探花在线精品一区二区 | 欧美一级艳情片免费观看 | 91精品国产91久久综合桃花 | 国产91视频一区二区 | 成人影院一区二区三区 | 久久久亚洲一区 | 欧美一二三区 | 999视频在线播放 | 一色桃子av一区二区 | 色婷婷综合网站 | 伊人狠狠 | 怡红院免费的全部视频 | 欧美日一区二区 | 噜噜噜噜狠狠狠7777视频 | 国产成人jvid在线播放 | 欧美成人精品在线观看 | 精品日韩 | 国产精品久久久久久妇女 | 色av一区二区三区 | 久久毛片 | 日本精品一区二区三区在线观看视频 | 欧美理伦片在线播放 | 国产97在线视频 | 日本黄色影片在线观看 | 日韩中文字幕一区二区 | 99精品国自产在线 | 亚洲一区二区三区免费在线 | 一区二区不卡高清 | 亚洲精品4 | 国产2区| 日韩一二区 | 男人天堂色 | 亚洲一区二区免费 | 国产福利视频导航 | 日韩欧美国产一区二区 |