Q
更改通知圖標
0
A
回答
1
發佈您的源代碼如何創建您的通知。
但通常,要更改通知圖標,只需調用setSmallIcon或setLargeIcon方法即可。這裏是一個例子:
Notification notif = new Notification.Builder()
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();
在你的情況,只是提供一個不同的圖標drawable給setSmallIcon方法。
+0
user1253575,你已經在你的[上一個問題](http://stackoverflow.com/questions/11379518/android-change-notification-icon)中詢問了這個問題,並在那裏得到了一個包含該信息的答案。如果你還不清楚,那就問問那裏。 – 2012-07-08 21:49:02
1
在比ICS
Notification notification = new Notification(R.drawable.logo, "", System.currentTimeMillis());
notification.largeIcon = your bitmap
notification.icon = your drawable
1
的android下你必須要實現自定義接收器的解析推送通知爲described in Parse's documentation。
這樣,解析是不會自動生成的Android用戶通知,然後你可以自己做,在較新的Android版本Notification.Builder
和Notification()
在較舊的Android版本,如在其他的答案中描述有提供自定義圖標。
相關問題
- 1. Javascript - 更改通知圖標
- 2. Android - 更改通知圖標
- 3. 更改標籤欄通知時點擊
- 4. 更改Unity中服務器端解析通知的推送通知圖標
- 5. 通知圖標
- 6. 通知圖標
- 7. GSEventRegisterEventCallBack - 獲取視圖更改通知
- 8. 如何在#flutter中更改推送通知的Android通知圖標/狀態欄圖標?
- 9. Android - 每次更改通知時更改通知的變量
- 10. 無法更改左側的電子通知圖標
- 11. 在運行時更改OSX通知中心圖標
- 12. 當通知到達時更改應用程序圖標徽章
- 13. 窗口通知圖標c#更改消息不刷新
- 14. IBM worklight 7.1更改推送通知圖標
- 15. 問:更改Android Studio中的通知圖標
- 16. 通過javascript更改鼠標圖標
- 17. 可以動態更改狀態欄的圖標(通知圖標)嗎?
- 18. iOS 10.3中的替代圖標:避免圖標更改的通知對話框
- 19. 根據FileSystemWatcher更改通知更改ObservableCollection
- 20. iPhone通知圖標
- 21. Android通知圖標
- 22. Android通知圖標
- 23. 位圖的通知圖標
- 24. MVC模型通知更改
- 25. C#委託通知更改
- 26. 電話SIM更改通知
- 27. 複選框 - 更改通知
- 28. 更改時通知WPF DataGrid
- 29. 顯示更改通知
- 30. 更改內容通知
你是說你使用[推送解析通知](https://www.parse.com/docs/android_guide#push)或什麼?請編輯你的問題,並更具體的方式。 – 2012-07-08 21:31:38
是的,我想爲我的通知使用其他圖標,這可能嗎? – Ahmad 2012-07-08 21:33:47