2011-08-22 7 views
1

내 안드로이드 응용 프로그램에서 알림을 표시하지 않고 소리로 사용자에게 알리고 싶습니다. 그게 가능하니? 알림 소리가 안드로이드에

Notification n = new Notification(); 
       n.icon = com.android.mms.R.drawable.wap_message; 
       n.defaults |= Notification.DEFAULT_SOUND; 
       n.flags = Notification.FLAG_AUTO_CANCEL; 

내가 통지를 보여주기 위해 사용하고있는 코드입니다, 그래서
Notification n = new Notification(); 
       //n.icon = com.android.mms.R.drawable.wap_message; 
       n.defaults |= Notification.DEFAULT_SOUND; 
       //n.flags = Notification.FLAG_AUTO_CANCEL; 

다음 그러나이 작동하지 않습니다 나는 아이콘과 알림의 국기 댓글을 달았습니다.

답변

1

알림 소리를 재생하는 데 Notification 대신 MediaPlayer을 사용하지 않는 이유는 무엇입니까? 알림을 사용하면 아이콘이 표시됩니다. 귀하의 경우에는 MediaPlayer을 사용하는 것이 더 좋습니다.