【发布时间】:2015-09-20 22:42:48
【问题描述】:
在 Android 6.0 (API 23) 中,方法 setLatestEventInfo(...) 已从类 android.app.Notification 中完全删除。我知道我现在必须使用Notification.Builder(context)....。新方法适用于较新的 Android 版本,但我仍想支持较旧的 Android 版本。
为了向后兼容,我现在将支持库 v4 添加到我的 gradle 文件中:
compile 'com.android.support:support-v4:23.0.1+'
不幸的是,我仍然无法使用 Android 6.0 的旧方法编译旧代码。
Error: cannot resolve method setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
我如何仍然使用旧方法来确保向后兼容到 Andoroid 2.3 (API 9)?
【问题讨论】:
标签: android android-support-library