Android的 - 改变我的Android编译目标4.3后,我得到编译错误 [英] Android - After changing my Android compile target to 4.3 I get compile error
问题描述
我有这样的code它用来做工精细
I have this code which used to work fine
Notification notification = new NotificationCompat.Builder(context)
.setContentTitle(title)
.setContentText(message)
.setContentIntent(intent)
.setSmallIcon(icon)
.setLights(Color.YELLOW, 1, 2)
.setAutoCancel(true)
.setSound(defaultSound)
.build();
但现在我更新了我的编译设置与Android 4.3和.build编译()方法似乎没有找到。会有人知道为什么会这样?
But now I updated my compile setting to compile with Android 4.3 and the .build() method seems to be not found. Would anyone know why this happened?
修改
和官方文件中,该.build()方法是正确的有:
的http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
And in the official documentation, the .build() method is right there: http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
推荐答案
也许你莫名其妙地回滚到旧版本的 Android的支持 - v4.jar的
,从后当它是的GetNotification()
而不是建立()
。请确保您使用的是最新 Android的支持 - v4.jar
。
Perhaps you somehow rolled back to an old version of android-support-v4.jar
, from back when it was getNotification()
instead of build()
. Make sure that you are on the latest android-support-v4.jar
.
这篇关于Android的 - 改变我的Android编译目标4.3后,我得到编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!