×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    5

    How to keep content of view during switching views

    Hi.

    I have 2 views and one container in each of them. Containers contains ListBox created dynamically. I'm switching between views in UI (class derived from CAknViewAppUi) like is it taking place in most of Symbian apps.

    During switching I use DoActivateL and DoDeactivate functions in each of view classes. It looks like:

    Code:
    void CsymContainerView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
    {
    	SetupStatusPaneL();
    	
    	if (iSymContainer == NULL)
    	{
    		iSymContainer = CreateContainerL();
    		iSymContainer->SetMopParent( this);
    		AppUi()->AddToStackL( *this, iSymContainer);
    	}
    	else
    	{
    		//AppUi()->AddToStackL( *this, iSymContainer);	
    	}
    }
    
    void CsymContainerView::DoDeactivate()
    {
    	CleanupStatusPane();
    
    	if (iSymContainer != NULL)
    	{
    		AppUi()->RemoveFromViewStack( *this, iSymContainer);
    		delete iSymContainer;
    		iSymContainer = NULL;
    	}
    }
    It runs ok but, every I switch to another view and back, the content is reseted and this is correct.
    If I uncommnent from DoActivateL():
    Code:
    //AppUi()->AddToStackL( *this, iSymContainer);
    and remove from DoDeactivate():
    Code:
    delete iSymContainer;
    iSymContainer = NULL;
    I can switch from first view to second but when I switch back to first I still see freezed content of second view's constainer. The menubar is switched correct, key events are handled proper even during debugging i know that I am working on correct container from first view but I see from second...

    What could be the problem? IMO it is connected to wrong refresh of ListBox implemented into view's containers.

    Please give me any hint. Sory for my English :).
    Hiero

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: How to keep content of view during switching views

    Check this pretty recent thread from an other member from Poland :-)
    http://discussion.forum.nokia.com/fo...d.php?t=145473

  3. #3
    Registered User
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    5

    Re: How to keep content of view during switching views

    Heh, it was easy for you wizard, parallel threads in the same time :).
    Nevertheless thank you, somebody could add that the second MakeVisible(ETrue) in DoDeactivate() should have converse parameter but it is easy to guess :).

    Again thank you for help.

    Regards
    Hiero

Similar Threads

  1. Switching Views
    By gammav in forum Symbian User Interface
    Replies: 12
    Last Post: 2008-07-01, 11:22
  2. Switching views
    By _fox in forum Symbian
    Replies: 6
    Last Post: 2006-09-26, 16:45
  3. Switching views with "memory" (S60 3rd)
    By uttumuttu in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-07-20, 15:55
  4. Audio Input Stream on N80
    By tkaihock in forum Symbian Media (Closed)
    Replies: 9
    Last Post: 2006-06-30, 09:15
  5. view switching problems
    By mankirath in forum Symbian
    Replies: 0
    Last Post: 2004-09-28, 07:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×