我知道getResources()
已被弃用。所以在我们可以做以下事情之前:
getResources().getColor(R.color.primary_color)
getResources().getColorStateList(R.color.selector_color_list)
getResources().getDrawable(R.drawable.icon)
我们现在必须这样做:
ContextCompat.getColor(context, R.color.primary_color)
ContextCompat.getColorStateList(getContext(), R.color.selector_color_list)
ContextCompat.getDrawable(context, R.drawable.icon)
我的问题是,在即将发布的版本中我们应该注意哪些内容已被弃用?
答案 0 :(得分:5)
API Diff包含full list of all removals:
虽然阅读有关主要更改的摘要的最佳位置是Behavior Changes documentation
- AbstractHttpParams
- ACCESS_MOCK_LOCATION
- ACCESS_SURFACE_FLINGER
- ACCESSIBILITY_FEATURES
- 帐户
- addSearchUrl(ContentResolver,String)
- AFFECTS_BATTERY
- AndroidHttpClient
- APP_INFO
- APPEND_FOR_LAST_AUDIBLE
- ArrayMap(ArrayMap)构造函数
- AUDIO_SETTINGS
- AUTHENTICATE_ACCOUNTS
- BasicEofSensorWatcher
- BasicHttpParams
- BasicManagedEntity
- BatteryManager()构造函数
- BLUETOOTH_NETWORK
- BOOKMARKS
- BOOKMARKS_URI
- BRICK
- Browser.BookmarkColumns
- Browser.SearchColumns
- canClearHistory(ContentResolver)
- ceil(float)
- CLEAR_APP_USER_DATA
- clearHistory(ContentResolver)
- clearSearches(ContentResolver)
- ClientConnectionManager
- ClientConnectionManagerFactory
- ClientConnectionOperator
- ClientConnectionRequest
- ConnectionKeepAliveStrategy
- ConnectionPoolTimeoutException
- ConnectionReleaseTrigger
- ContactsContract.Contacts.StreamItems
- ContactsContract.RawContacts.StreamItems
- ContactsContract.StreamItemPhotos
- ContactsContract.StreamItemPhotosColumns
- ContactsContract.StreamItems
- ContactsContract.StreamItems.StreamItemPhotos
- ContactsContract.StreamItemsColumns
- CoreProtocolPNames
- cos(float)
- COST_MONEY
- createFromPdu(byte [])
- createFromXml(Resources,XmlPullParser)
- DefaultedHttpParams
- deleteFromHistory(ContentResolver,String)
- deleteHistoryTimeFrame(ContentResolver,long,long)
- DEVELOPMENT_TOOLS
- DEVICE_ALARMS
- DEVICE_POWER
- DISPLAY
- EofSensorInputStream
- EofSensorWatcher
- 执行()
- exp(float)
- floor(float)
- FORCE_BACK
- GET_TOP_ACTIVITY_INFO
- getAllBookmarks(ContentResolver)
- getAllVisitedUrls(ContentResolver)
- getColor(int)
- getColorStateList(int)
- getHttpSocketFactory(int,SSLSessionCache)
- HARDWARE_CONTROLS
- HARDWARE_TEST
- HISTORY_PROJECTION
- HISTORY_PROJECTION_BOOKMARK_INDEX
- HISTORY_PROJECTION_DATE_INDEX
- HISTORY_PROJECTION_FAVICON_INDEX HISTORY_PROJECTION_ID_INDEX
- HISTORY_PROJECTION_TITLE_INDEX
- HISTORY_PROJECTION_URL_INDEX
- HISTORY_PROJECTION_VISITS_INDEX
- HttpAbstractParamBean
- HttpConnectionParamBean
- HttpHostConnectException
- HttpProtocolParamBean
- HttpProtocolParams
- hypot(float,float)
- INJECT_EVENTS
- INTERNAL_SYSTEM_WINDOW
- MANAGE_ACCOUNTS
- MANAGE_APP_TOKENS
- ManagedClientConnection
- mCurrentRowID
- MESSAGES
- mRowIdColumnIndex
- MultihomePlainSocketFactory
- mUpdatedRows
- NETWORK
- onAttach(活动)
- onReceivedError(WebView,int,String,String)
- onSendDataSms(byte [],int,String,int,ResultCallback)
- onSendMultipartTextSms(List,int,String,ResultCallback)
- onSendTextSms(String,int,String,ResultCallback)
- OperatedClientConnection
- org.apache.commons.logging
- org.apache.http
- org.apache.http.auth
- org.apache.http.auth.params
- org.apache.http.client
- org.apache.http.client.entity
- org.apache.http.client.methods
- org.apache.http.client.params
- org.apache.http.client.protocol
- org.apache.http.client.utils
- org.apache.http.conn.params
- org.apache.http.conn.routing
- org.apache.http.conn.util
- org.apache.http.cookie
- org.apache.http.cookie.params
- org.apache.http.entity
- org.apache.http.impl
- org.apache.http.impl.auth
- org.apache.http.impl.client
- org.apache.http.impl.conn
- org.apache.http.impl.conn.tsccm
- org.apache.http.impl.cookie
- org.apache.http.impl.entity
- org.apache.http.impl.io
- org.apache.http.io
- org.apache.http.message
- org.apache.http.protocol
- org.apache.http.util
- PERSONAL_INFO
- PHONE_CALLS
- PlainSocketFactory
- play(Context,Uri,boolean,int)
- pow(float,float)
- READ_HISTORY_BOOKMARKS
- READ_PROFILE
- READ_SOCIAL_STREAM
- READ_USER_DICTIONARY
- RecoverySystem()构造函数
- requestAllIcons(ContentResolver,String,IconListener)
- REQUESTED_PERMISSION_REQUIRED
- saveBookmark(Context,String,String)
- 方案
- SchemeRegistry
- SCREENLOCK
- SEARCHES_PROJECTION
- SEARCHES_PROJECTION_DATE_INDEX
- SEARCHES_PROJECTION_SEARCH_INDEX
- SEARCHES_URI
- SET_ACTIVITY_WATCHER
- SET_ORIENTATION
- SET_POINTER_SPEED
- setColorFilter
- 在android.graphics.drawable.ClipDrawable
中输入(ColorFilter)- 在android.graphics.drawable.InsetDrawable
中输入类型(ColorFilter)- android.graphics.drawable.RotateDrawable
中的type(ColorFilter)- 在android.graphics.drawable.ScaleDrawable
中输入(ColorFilter)- setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
- 罪(浮动)
- SOCIAL_INFO
- sqrt(float)
- startSession(Bundle)
- STATUS_BAR
- SUBSCRIBED_FEEDS_READ
- SUBSCRIBED_FEEDS_WRITE
- SYNC_SETTINGS
- SYSTEM_CLOCK
- SYSTEM_TOOLS
- TRUNCATE_HISTORY_PROJECTION
- TRUNCATE_HISTORY_PROJECTION_ID_INDEX
- TRUNCATE_N_OLDEST
- truncateHistory(ContentResolver)
- updateVisitedHistory(ContentResolver,String,boolean)
- USE_CREDENTIALS
- USER_DICTIONARY
- VOICEMAIL
- VOLUME_ALARM
- VOLUME_BLUETOOTH_SCO
- VOLUME_MUSIC
- VOLUME_NOTIFICATION
- VOLUME_RING
- VOLUME_SETTINGS
- VOLUME_SYSTEM
- VOLUME_VOICE
- WALLPAPER
- WRITE_HISTORY_BOOKMARKS
- WRITE_PROFILE
- WRITE_SMS
- WRITE_SOCIAL_STREAM
- WRITE_USER_DICTIONARY
- 在android.Manifest.permission
中- 在android.Manifest.permission_group
中