Qns Regarding ActiveViewId ???

Login to reply to this topic.
Sun, 2007-09-09 14:00
Joined: 2007-06-20
Forum posts: 93

hi,
I want to know that GetActiveViewId() methods return ActiveViewId when App is in ForeGround or also when App is in Background ???

just use like this :

GetActiveViewId(aViewId);
if(aViewId.iViewUid==TUid::Uid(EMyApplicationAppView1Id))
{
// do something
}

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,
C Singh


Tue, 2007-09-11 09:59
Joined: 2007-06-20
Forum posts: 93
Re: Qns Regarding ActiveViewId ???

I m still waiting for someone reply, can anybody help plz ?


Thanks & Regards,
C Singh

Tue, 2007-09-11 10:11
Joined: 2004-05-21
Forum posts: 285
Re: Qns Regarding ActiveViewId ???

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

Wed, 2007-09-12 11:00
Joined: 2007-06-20
Forum posts: 93
Re: Qns Regarding ActiveViewId ???

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

Wed, 2007-09-12 04:53
Joined: 2004-05-21
Forum posts: 285
Re: Qns Regarding ActiveViewId ???

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

Wed, 2007-09-12 11:04
Joined: 2006-10-05
Forum posts: 80
Re: Qns Regarding ActiveViewId ???

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.

Wed, 2007-09-12 11:44
Joined: 2007-06-20
Forum posts: 93
Re: Qns Regarding ActiveViewId ???

hi jp,
plz check ur PMesaage.


Thanks & Regards,
C Singh

Thu, 2007-09-13 15:34
Joined: 2006-03-03
Forum posts: 31
Re: Qns Regarding ActiveViewId ???

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

Thu, 2007-09-13 15:56
Joined: 2006-03-03
Forum posts: 31
Re: Qns Regarding ActiveViewId ???

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

  • Login to reply to this topic.