I want a program which is notified when a media card is removed. I have based my class on the nokia forum wiki
It is important to set the app's system attribute to prevent it from being closed. With a s60 app, this will work:
CEikonEnv::Static()->SetSystem( ETrue );
For my purposes I need a background process which will be restart when the phone reboots(ie, no UI). The wiki recommends...
iWg = new (ELeave) RWindowGroup( iWs );
User::LeaveIfError( iWg->Construct( (TUint32)iWg, EFalse ) );
iWg->SetOrdinalPosition( -1 );
iWg->EnableReceiptOfFocus( EFalse );
iWgName = CApaWindowGroupName::NewL( iWs );
iWgName->SetSystem( ETrue );
iWgName->SetHidden( ETrue );
iWgName->SetWindowGroupName( *iWg );
Notice we are using iWgName->SetSystem(ETrue). This is of type CApaWindowGroupName. Unfortunately, when the card is removed the daemon program is closed. Do you know how I can make the daemon behave like the s60 app?
Thanks for your time and consideration.