0
A
回答
0
這裏爲例設備的默認的通知聲音:
protected void GenerateNotify() {
NotificationManager myNotificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification=new Notification(android.R.drawable.ic_btn_speak_now,"hi",100);
Intent intent=new Intent(getApplicationContext(),as.class);
PendingIntent contentintent=PendingIntent.getBroadcast(getApplicationContext(),0, intent, 0);
notification.setLatestEventInfo(getApplicationContext(), "Hi","date", contentintent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.sound = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.notifysnd);
notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;
}
之前做這個請把MP3文件到原始文件夾,然後導航改正路徑
相關問題
- 1. 如何「掛鉤」通知對象
- 2. 掛鉤或不掛鉤 - git
- 3. API無掛鉤掛鉤
- 4. 谷歌聯繫人廣播/推送/通知/掛鉤API
- 5. 無法通過掛鉤
- 6. Android文件系統掛鉤
- 7. 如何知道掛鉤的鍵盤ID?
- 8. 監視TFS服務掛鉤/ Web掛鉤
- 9. IAT掛鉤 - 無法掛鉤ExitProcess
- 10. SetParent掛鉤,你怎麼解除掛鉤?
- 11. 在掛鉤程序中訪問掛鉤
- 12. 顛覆電子郵件提交通知沒有掛鉤
- 13. 啓用集成SMTP通知與自制掛鉤
- 14. 掛鉤接收窗口創建和銷燬通知
- 15. 掛鉤通知eclipse工作區被加載
- 16. 爲所有達爾文通知掛鉤CFNotificationCenter - iOS
- 17. Gitorious是否掛鉤了CIA提交通知?
- 18. ios 5如何掛鉤鎖屏通知警報與滑塊?
- 19. solr是否有post-commit掛鉤(或其他)來通知slave?
- 20. 有沒有人知道可以掛鉤Dotnet方法的掛鉤/繞行庫?
- 21. TSLint預先掛鉤鉤子
- 22. 掛鉤與DLL遊戲鉤
- 23. Drupal EntityForm掛鉤
- 24. PR_Write掛鉤後
- 25. IMAGE_DOS_HEADER掛鉤
- 26. Ejabberd從掛鉤
- 27. Wordpress掛鉤
- 28. 掛鉤 - hotpatching
- 29. rbenv掛鉤
- 30. Windows DNS掛鉤
此代碼是創建一個新的通知,這不是我去我會「勾住所有其他人」,並在每個鉤子觸發代碼來更改默認系統通知聲音 – TheTrigger