知識點總結

2021-07-31 06:43:55 字數 809 閱讀 4478

oncreate()

onstrat()

onresume() <--

onpause()---

onstop() -->onrestart()

ondestroy()

standard  啟動activity都會產生乙個新的activity  預設模式

singletop 啟動activity允許多個,但不允許重疊

singletask 只允許有乙個activity

singleinstance 會建乙個新task 裡面只能有乙個activity

onterminate() 程式終止時執行

onlowmemory() 記憶體低時執行

ontrimmemory() gc時執行

1. 通過startservice啟動

oncreate()

onstartcommand()

ondestroy()

2. 通過bindservice 啟動

oncreate()

onbind()

onstartcommand()

onunbind()

ondestroy()

記憶體溢位是oom,記憶體洩漏是指沒有把一些記憶體釋放

方法 原理

工廠模式 factory

建造者模式(builder)

軟引用

弱引用

虛引用measure->layout->draw

知識點總結

1,迴圈中的中斷 continue 跳出此次迴圈,繼續for迴圈 break 跳出當前for迴圈 return 跳出當前方法 2,字串的操作 componentseparatedbystring stringbyreplacingoccurencesofstring withstring iskin...

知識點總結

function go go 呼叫 go為變數名 setinterval go,1000 1000ms clearinterval 關閉定時器 function abc a,b 2,3 5undefined 未定義 null 空 nan 非數值 string 字串 var a 123 數字型別 va...

知識點總結

1 redis資料庫 功能 主要是用來做快取的非關係型資料庫。基本資料型別 字串 string 雜湊 hash 列表 list 集合 set 有序集合 sorted set 主要使用場景 當資料不常用時適合做快取可以用redis,提高頁面載入速度。2 svn和git的區別 1.git是分布式的,而s...