Qns Regarding ActiveViewId ???
| Sun, 2007-09-09 14:00 | |
|
|
hi, just use like this : GetActiveViewId(aViewId);I m facing a problem b'cz when my App is in ForeGround control goes inside if() condition but when App is in Background control not goes inside if() condition. Its my doubt so anybody clear that plz ??? Thanks & Regards, |






Forum posts: 93
I m still waiting for someone reply, can anybody help plz ?
Thanks & Regards,
C Singh
Forum posts: 285
AFAIK it returns the active viewid in an application in which GetActiveViewId is called. There shouldnt be any change whether the app is in foreground or background.
Cheers,
Sri
Forum posts: 93
hi srikanth,
I m confused now.... plz take a look to reply now by someone in forum nokia.. links is :- http://discussion.forum.nokia.com/forum/showthread.php?p=341820#post341820
and also if work on foreground and background also then in my app its not working correctly, plz clearify me .. code is here :-
TVwsViewId viewId1;
CEikonEnv::Static()->EikAppUi()->GetActiveViewId(viewId1 );
if(viewId.iViewUid==TUid::Uid(EMyApplicationAppView1Id))
{
// do something when my app is in foreground control comes inside if but it not comes when app is in backgroud
}
Thanks & Regards,
C Singh
Forum posts: 285
If you see the documentation it says "Gets the ID of the app UI's currently active view". It says app Ui and not phone UI. This means it should give the active view id of the application irrespective of it being in foreground or background. Though I havent tried this.
Cheers,
Sri
Forum posts: 80
Hi Chandan,
AFAIK, once your application goes into background, it will not receive events the same way as it receives when it is in foreground.
Once your application goes in background, none of the views in your application will be the current view.
I think you have to first bring your application to Foreground (by clicking on its Menu icon) and then your application's currently active view can be identified.
If possible elaborate on what exact functionality you want, then maybe i can help more.
Forum posts: 93
hi jp,
plz check ur PMesaage.
Thanks & Regards,
C Singh
Forum posts: 31
I think that when the HandleForegroundEvent callback is called GetActiveView gives KErrNotFound so that means there is no view is active in that moment.
I dont know how resolve it. I am dealing with the same problem in this moment.
Any ideas?
Best regards,
mopa
Forum posts: 31
This is a possible solution:
Declare a member variable tu store the view when de application is deactivated. And then look into this variable in HandleForegroundL method.
This would be the code:
(AppUi.h)
TVwsViewId iCurentView;
(AppUi.cpp)
HandleForegroundEventL(aForeground)
{
if (!aForeground)
GetActiveViewId(iCurrentView);
else
{
if(iCurrentView==TUid::Uid(EMyApplicationAppView1Id))
{
// do something
}
}
}
I hope this will be helpful for you,
best regards,
mopa