1、關(guān)于targetAPI 疙驾,最明顯的就是權(quán)限管理那塊兒了杠河,如果你的目標設(shè)備是運行在Android6.0以下的,那么直接把targetAPI設(shè)置低一點就OK了傻咖,這樣就可以避免權(quán)限的申請了朋魔。
2、ROOM和DataBinding的天坑
room有問題卿操,但是room不報錯警检,databinding報錯??。
我把room 的dao里面的insert的返回值寫成了int害淤。然后就報錯了
錯誤: 找不到符號 protected 符號: 類 DataBindingComponent
解決方法就是把int改為long扇雕。這里的long表示的是行號
官網(wǎng)原文
- If the
@Insert
method receives only 1 parameter, it can return along
, which is the newrowId
for the inserted item. If the parameter is an array or a collection, it should returnlong[]
orList<Long>
instead.