Android 向后兼容性问题(SetLateStevenInfo)

Android 向后兼容性问题(SetLateStevenInfo),android,android-support-library,Android,Android Support Library,在Android 6.0(API 23)中,setLateStevenInfo(…)方法从类Android.app.Notification中完全删除。我知道我现在必须使用Notification.Builder(上下文)…。新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本 为了向后兼容,我现在将支持库v4添加到我的gradle文件中: 编译'com.android.support:support-v4:23.0.1+' 不幸的是,我仍然无法使用Android 6.

在Android 6.0(API 23)中,
setLateStevenInfo(…)
方法从类
Android.app.Notification
中完全删除。我知道我现在必须使用Notification.Builder(上下文)…。新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本

为了向后兼容,我现在将支持库v4添加到我的gradle文件中:

编译'com.android.support:support-v4:23.0.1+'

不幸的是,我仍然无法使用Android 6.0使用旧方法编译旧代码

错误:无法解析方法SetLateStevenInfo(上下文、CharSequence、CharSequence、PendingContent)

如何仍然使用旧方法确保向后兼容到Andoroid 2.3(API 9)?

所有的都与Android 1.6和更高版本的设备兼容-您应该使用它来支持所有API级别。

所有的都与Android 1.6和更高版本的设备兼容-您应该使用它来支持所有API级别。

所有的都与Android 1.6和更高版本的设备兼容-您应该使用它来支持所有API级别级别。

所有的都与Android 1.6及更高版本的设备兼容-您应该使用它来支持所有API级别

新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本

android.support.v4.app.NotificationCompat.Builder
,从您加载的支持库返回到API级别4

不幸的是,我仍然无法使用Android 6.0使用旧方法编译旧代码

对。您应该从加载的支持库中将
setLateStevenInfo()
转换为使用
android.support.v4.app.NotificationCompat.Builder

具体来说,调用
setContentTitle()
setContentText()
setContentIntent()
来复制从
setLatestEventInfo()
获得的内容

或者,将
compileSdkVersion
降至22或更低。出于向后兼容的原因,我强烈怀疑
setLatestEventInfo()
仍然存在,但它不再是SDK的一部分

新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本

android.support.v4.app.NotificationCompat.Builder
,从您加载的支持库返回到API级别4

不幸的是,我仍然无法使用Android 6.0使用旧方法编译旧代码

对。您应该从加载的支持库中将
setLateStevenInfo()
转换为使用
android.support.v4.app.NotificationCompat.Builder

具体来说,调用
setContentTitle()
setContentText()
setContentIntent()
来复制从
setLatestEventInfo()
获得的内容

或者,将
compileSdkVersion
降至22或更低。出于向后兼容的原因,我强烈怀疑
setLatestEventInfo()
仍然存在,但它不再是SDK的一部分

新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本

android.support.v4.app.NotificationCompat.Builder
,从您加载的支持库返回到API级别4

不幸的是,我仍然无法使用Android 6.0使用旧方法编译旧代码

对。您应该从加载的支持库中将
setLateStevenInfo()
转换为使用
android.support.v4.app.NotificationCompat.Builder

具体来说,调用
setContentTitle()
setContentText()
setContentIntent()
来复制从
setLatestEventInfo()
获得的内容

或者,将
compileSdkVersion
降至22或更低。出于向后兼容的原因,我强烈怀疑
setLatestEventInfo()
仍然存在,但它不再是SDK的一部分

新方法适用于较新的Android版本,但我仍然希望支持较旧的Android版本

android.support.v4.app.NotificationCompat.Builder
,从您加载的支持库返回到API级别4

不幸的是,我仍然无法使用Android 6.0使用旧方法编译旧代码

对。您应该从加载的支持库中将
setLateStevenInfo()
转换为使用
android.support.v4.app.NotificationCompat.Builder

具体来说,调用
setContentTitle()
setContentText()
setContentIntent()
来复制从
setLatestEventInfo()
获得的内容


或者,将
compileSdkVersion
降至22或更低。出于向后兼容的原因,我强烈怀疑
setLatestEventInfo()
仍然存在,但它不再是SDK的一部分。

完美!秘密在于类
android.support.v4.app.NotificationCompat.Builder
。只要我使用NotificationCompat,一切都会很完美。非常感谢。完美的秘密在于类
android.support.v4.app.NotificationCompat.Builder
。只要我使用NotificationCompat,一切都会很完美。非常感谢。完美的秘密在于类
android.support.v4.app.NotificationCompat.Builder
。只要我使用NotificationCompat,一切都会很完美。非常感谢。完美的秘密在于类
android.support.v4.app.NotificationCompat.Builder
。只要我使用NotificationCompat,一切都会很完美。非常感谢。