notification.setLatestEventInfo(
MainActivity.this,
getString(R.string.app_name),
"我是string",
報錯:參數不匹配
(並提示我我寫的參數是 MainActivity.this, string, string, contentIntent)
這明明是正常的參數= =,是android的api不一樣了還是另有原因?
1.首先這個在高版本的api 中不建議使用了;
2.估計你最後一個參數真的不對
public void setLatestEventInfo (Context context, CharSequence contentTitle, CharSequence contentText, PendingIntent contentIntent)
Added in API level 1
This method was deprecated in API level 11.
Use Notification.Builder instead.
最後一個參數是 PendingIntent 你可能當成 Intent