phonebookui/Phonebook2/UIControls/src/CPbk2NamesListControl.cpp
branchRCL_3
changeset 14 81f8547efd4f
parent 3 04ab22b956c2
child 15 e8e3147d53eb
--- a/phonebookui/Phonebook2/UIControls/src/CPbk2NamesListControl.cpp	Fri Feb 19 22:40:27 2010 +0200
+++ b/phonebookui/Phonebook2/UIControls/src/CPbk2NamesListControl.cpp	Fri Mar 12 15:41:25 2010 +0200
@@ -44,6 +44,7 @@
 #include <CPbk2ThumbnailManager.h>
 #include <Pbk2CommonUi.rsg>
 #include <Pbk2UIControls.rsg>
+#include "CPbk2AppUi.h"
 
 // Virtual Phonebook
 #include <MVPbkContactViewBase.h>
@@ -2160,7 +2161,10 @@
 	//Prevent messing with focus with always-on when Phonebook hidden in 
 	//reseted state. Otherwise background-added contacts will change focus. 
 	//This would cause Phonebook not to look like freshly started when opened again.
-    if(iCurrentState->NamesListState() != CPbk2NamesListControl::EStateHidden)
+	//And also make sure foreground-added contact will show the new contact 
+	//even though the focus is not seen.
+    if( (static_cast<CPbk2AppUi*>(
+            CEikonEnv::Static()->AppUi()))->IsForeground() )
         {
         SelectAndChangeReadyStateL(); 
         }