android 關於getResources().getColor() 過時問題

getResources().getColor() 已經過時

'getcolor (int)' is obsolete less... (Ctrl + F1)

Obsolete classes or methods cannot be used. Note: the method decode (string EncodeStr) in java.net.urldecoder is out of date, so double parameter decode (string source, string encode) should be used. Since the interface provider is clearly an obsolete interface, it has the obligation to provide a new interface at the same time; as the caller, it has the obligation to verify what the new implementation of the obsolete method is.

將使用

ContextCompat.getColor(context,id) 替代

記錄一下

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章