how to get current active view ???

Login to reply to this topic.
Fri, 2007-07-27 13:26
Joined: 2007-06-20
Forum posts: 93

hi,
My app has three view. i want to know that how or from which methods i know that which view is
actived currently ???
I m working on S60 2nd Edition FP3.....


Thanks & Regards,
C Singh


Fri, 2007-07-27 16:42
Joined: 2007-06-21
Forum posts: 82
Re: how to get current active view ???

Have a state machine...

private :// Data
enum TCurrentView
{
EMyFirstView= 0, // First View

EMySecondView, //Second View

EMyThirdView //Third View

};
Something like that in your View source file... n keep track

Simple Smiling

Br
G;p
http://mobisyblog.blogspot.com

Fri, 2007-07-27 16:51
Joined: 2007-06-20
Forum posts: 93
Re: how to get current active view ???

hi,
My App has CallWatcher class which listen incoming calls. I want to know which view is active in this class.... for this i try following code... plz tell me that i m right or wrong..?

TInt CXXXXCallWatcher::GettingId() const
    {
   
      TVwsViewId viewId;       
      return CEikonEnv::Static()->EikAppUi()->GetActiveViewId(viewId );
      
    }

and i check like this where i need in CallWatcher class
if(GettingId()==EXXXXCmdRejectAllOn)
  {
  // do something which i need...                   
}


Thanks & Regards,
C Singh

Fri, 2007-07-27 16:56
Joined: 2007-06-21
Forum posts: 82
Re: how to get current active view ???

Yes this is right, if you have three View Classes, and you switch between them.....

I thought that you have only one view class, and in that you have different view controls......

Fri, 2007-07-27 16:58
Joined: 2007-06-20
Forum posts: 93
Re: how to get current active view ???

ok Thanx for guide me.... one another problem occured that when i use this code and install in real device My App crashes when call is coming ..... Now how i check what exactly problem is ???


Thanks & Regards,
C Singh

Sat, 2007-07-28 20:08
Joined: 2007-06-21
Forum posts: 82
Re: how to get current active view ???

Thats lil tricky.......
1. Normally I put alerts at diff places and check on device..
2. but if you have carbide developer or professional, you can do target debugging too,,
3. Other way is to crate a debug file like C:\data\debug\mydebugfile.txt and keep on writing it from ur code.
After the crash, when you boot your phone the next time, have a look at this file, it can tell you approx location of crash..
May be there are better ways, But I normally user 1 and 3. Eye-wink
Br
G;p

Sat, 2007-07-28 22:20
Joined: 2007-06-20
Forum posts: 93
Re: how to get current active view ???

Thanx for reply, I try to do as u suggest and post again if i face any problem.....


Thanks & Regards,
C Singh

  • Login to reply to this topic.