tags:

views:

128

answers:

0

Hi

I'm doing an app that need to notify the user doing a call that the call is taking to long... I got every thing up an running and an the notification is made at the right time (I can see it at the status bar) but with no sound. If I make the notification call when there is no call the sound is played.

My notification looks like this:

        NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    int icon = R.drawable.icon;
    CharSequence tickerText = "Hello From CallTimerService";
    long when = System.currentTimeMillis();

    Notification notification = new Notification(icon, tickerText, when);

    Context context = getApplicationContext();
    CharSequence contentTitle = "My notification";
    CharSequence contentText = "ss";
    Intent notificationIntent = new Intent(this, CallTimer.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
    notification.defaults = Notification.DEFAULT_SOUND;
    notification.flags |= Notification.FLAG_AUTO_CANCEL;

    mNotificationManager.notify(2, notification);

I also tried changing the notification.audioStreamType using the AudioManager.STREAM_ but with no luck.

Do any body now how to do this? or just an good idea what to try next....