×
Namespaces

Variants
Actions

Keypad sound is lost when focus returns to the Symbian app

From Nokia Developer Wiki
Jump to: navigation, search



Article Metadata
Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 2nd Edition (initial release)
S60 1st Edition
Article
Created: User:Technical writer 2 (04 May 2004)
Last edited: hamishwillee (14 Jun 2012)

Overview

Our application launches external applications, but sounds generated by the phone when the keypad is used are not heard when our application is re-entered through the Tasks list or when the launched application is closed. The launched applications include, for example, camera, video, messages, and agenda. To hear the keypad tones again, our application has to be closed and opened again.

Description

According to the specifications, the CAknKeySoundSystem takes care of generating sounds. Its BringToForegorund() method tells the server that this client is now in the foreground, and that it's context stack should be used for processing sounds.
This is called automatically by CAknAppUi:
void CAknAppUi::HandleForegroundEventL(TBool aForeground)
{
if (iKeySounds && aForeground)
{
iKeySounds->BringToForeground();
 }
CEikAppUi::HandleForegroundEventL(aForeground);
}

Solution

When you use the ways described in the Nokia Developer document Utilizing External Application Views to switch between application, make sure that you call the base class function:
CAknAppUi::HandleForegroundEventL(aForeground);
in your overloaded implementation of HandleForegroundEventL()  - otherwise the keypad sounds will be lost.
For example,
void CMyViewAppUi::HandleForegroundEventL(TBool aForeground)
{
CAknAppUi::HandleForegroundEventL(aForeground);
... // Application-specific code on Focus change
}

This page was last modified on 14 June 2012, at 07:53.
42 page views in the last 30 days.
×