2013-03-21 56 views
1

好吧,我的一些习惯说我的APP 有时候在收到GCM推送消息时没有播放通知声音...(Phone is samsung galaxy s3 and I'm sure sure the phone处于RING模式,而不是无声或振动模式)android播放通知有时没有声音

我想也许他们没有选择任何文件作为通知声音,所以我更改我的代码以仅播放默认声音。

这里是我的代码播放默认通知声音:

Ringtone r=null; 
    try 
    { 
     Uri uri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); 
     r=RingtoneManager.getRingtone(getApplicationContext(), uri); 
     r.play(); 
    } 
    catch(Exception e) 
    {e.printStackTrace();} 

所以我得到他们的S3,看看发生了什么事情。

,但没有任何错误消息,没有任何错误堆出来的,它只是没有发挥默认的通知声音......

Android设备(S)我没试过:

  • HTC蝴蝶(在美国称为DroidDNA完全相同模块)
  • HTC DesireHD
  • 的HTC Desire
  • 宏碁A100(7" 平板电脑)
  • samsung note2

5个以上设备播放notificatoin声音不错。

为什么三星S3不播放通知声音有时 ......

任何想法?

回答

1

仍然不知道为什么三星的Android手机事业这个问题(和HTC &宏碁运作良好)

我也通过下面的代码解决了这个问题:

PendingIntent contentIntent=PendingIntent.getActivity(this, 0, notificationIntent, 0); 
    Notification notification=new Notification(R.drawable.icon_notify, tickerText, when); 
    if(allow play nitify){notification.defaults|=Notification.DEFAULT_SOUND;} 
    if(allow vibrate){notification.defaults|=Notification.DEFAULT_VIBRATE;} 

所以我想我可以“T附上我自己的通知声音我APP几个时间...

三星,太好了,好了...... $ & $#^%^ & $^@ &%


编辑:2013年3月29日上午10:05 GMT + 8

以上代码仍然在三星S3同样的问题,但其他设备列表的上方,甚至三星注2工作正常。

samsung s3 SUCKS!