A.setContentView()可以通過(guò)注解實(shí)現(xiàn)
B.setContentView()不能通過(guò)注解實(shí)現(xiàn)
C.都能通過(guò)注解實(shí)現(xiàn)
D.都不能通過(guò)注解實(shí)現(xiàn)
您可能感興趣的試卷
你可能感興趣的試題
A.當(dāng)View需要更新時(shí),首先去找Controller,然后Controller找Model獲取數(shù)據(jù),Model獲取到數(shù)據(jù)之后直接更新View
B.當(dāng)View需要更新時(shí),首先去找Model獲取數(shù)據(jù),Model獲取到數(shù)據(jù)之后直接更新View
C.當(dāng)View需要更新時(shí),首先去找Controller,然后Controller找Model獲取數(shù)據(jù),Model獲取到數(shù)據(jù)之后直接更新Controller,就顯示了
D.當(dāng)View需要更新時(shí),首先去找Controller,然后Controller找Model獲取數(shù)據(jù),Controller獲取到數(shù)據(jù)之后直接更新View
A.View不可以直接訪問(wèn)Model的
B.View就是Activity
C.View是可以直接訪問(wèn)Model的
D.View就是fragment
A.當(dāng)View需要更新數(shù)據(jù)時(shí),首先去找Model,然后Presenter去找Model請(qǐng)求數(shù)據(jù),Model獲取到數(shù)據(jù)之后通知Presenter,Presenter再通知Model更新數(shù)據(jù)
B.當(dāng)View需要更新數(shù)據(jù)時(shí),首先去找Presenter,然后Presenter去找Model請(qǐng)求數(shù)據(jù),Model獲取到數(shù)據(jù)之后通知Presenter,Model再通知View更新數(shù)據(jù)
C.當(dāng)View需要更新數(shù)據(jù)時(shí),首先去找Presenter,然后Presenter去找Model請(qǐng)求數(shù)據(jù),Model獲取到數(shù)據(jù)之后通知Presenter,Presenter再通知View更新數(shù)據(jù)
D.當(dāng)View需要更新數(shù)據(jù)時(shí),首先去找Presenter,然后Presenter去找Model請(qǐng)求數(shù)據(jù),Presenter獲取到數(shù)據(jù)之后通知model,Presenter再通知View更新數(shù)據(jù)
A.Moder-View-Presenter
B.Model-Video-Presenter
C.Model-View-Picture
D.Model-View-Presenter
A.第一,將我們需要注入的對(duì)象的類(lèi)的構(gòu)造參數(shù)使用@Inject標(biāo)注,告訴dagger2它可以實(shí)例化這個(gè)類(lèi);
B.兩個(gè),第二,編寫(xiě)Component接口使用@Component進(jìn)行標(biāo)注,里面的voidinject()的參數(shù)表示要將依賴(lài)注入到的目標(biāo)位置;
C.第三,使用androidstudio的Build菜單編譯一下項(xiàng)目,使它自動(dòng)生成我們編寫(xiě)的Component所對(duì)應(yīng)的類(lèi),生成的類(lèi)的名字的格式為“Dagger+我們所定義的Component的名字”;
D.第四,在需要注入的類(lèi)中使用@Inject標(biāo)注要注入的變量;然后調(diào)用自動(dòng)生成的Component類(lèi)的方法create()或builder().build(),然后inject到當(dāng)前類(lèi);在這之后就可以使用這個(gè)@Inject標(biāo)注的變量了。

最新試題
在ItemDetailsViewModel中,uiState的作用是什么()
創(chuàng)建實(shí)體類(lèi)時(shí),哪個(gè)注解用來(lái)標(biāo)記數(shù)據(jù)庫(kù)實(shí)體類(lèi)()
在WorkManager中,哪個(gè)方法用于設(shè)置WorkRequest的輸入數(shù)據(jù)()
在WorkManager中,哪種狀態(tài)表示工作已完成()
Room是在哪個(gè)數(shù)據(jù)庫(kù)基礎(chǔ)上構(gòu)建的抽象層()
ViewModel的數(shù)據(jù)會(huì)在Android系統(tǒng)銷(xiāo)毀并重新創(chuàng)建activity時(shí)丟失。
StateFlow的生命周期由什么定義()
在WorkManager中,哪個(gè)方法用于檢查工作是否已被取消()
以下哪個(gè)不是創(chuàng)建數(shù)據(jù)庫(kù)實(shí)例的步驟()
在創(chuàng)建DAO時(shí),哪個(gè)注解用來(lái)定義執(zhí)行簡(jiǎn)單插入的方法()