×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    6

    touch phone crash when touch option menu

    Hi,
    I am developing application in touch phone like N97, expressmusic5800.
    I made a simple application which has just 2 page.
    The one view is main (TestContainerView/TestContainer) and the other view(TestContainer2View/TestContainer2) include just CEikEdwin.

    When I moved from main page to second page, back to main page and press option menu and just scroll the menu, the application is crashed.
    The same code is work in non touch phone like E71, E75, E90, etc...

    Thanks advance.

    ---------------------------- TestAppUi.cpp ------------------------------------
    void CTestAppUi::ConstructL()
    {
    BaseConstructL(EAknEnableSkin | EAknTouchCompatible);
    InitializeContainersL();
    }

    void CTestAppUi::GoToView()
    {
    ActivateLocalViewL( TUid::Uid(ETestContainerViewId));
    }

    void CTestAppUi::GoToView2()
    {
    ActivateLocalViewL( TUid::Uid(ETestContainer2ViewId));
    }
    ---------------------------------------------------------------------

    ------------------ TestContainerView.cpp ---------------------
    TBool CTestContainerView::HandleEdwinMenuItemSelectedL( TInt aCommand )
    {
    ((CTestAppUi *)AppUi())->GoToView2();
    return ETrue;
    }
    ----------------------------------------------------------------

    ------------------ TestContainer2View.cpp ---------------------
    void CTestContainer2View::HandleCommandL( TInt aCommand )
    {
    TBool commandHandled = EFalse;
    switch ( aCommand )
    { // code to dispatch to the AknView's menu and CBA commands is generated here
    case EAknSoftkeyOk:
    commandHandled = HandleOKMenuItemSelectedL( aCommand );
    break;
    default:
    break;
    }
    .....

    }
    TBool CTestContainer2View::HandleOKMenuItemSelectedL( TInt aCommand )
    {
    ((CTestAppUi *)AppUi())->GoToView();
    return ETrue;
    }

    ----------------------------------------------------------------

    ------------------ TestContainer2.cpp ---------------------
    void CTestContainer2::ConstructL(
    const TRect& aRect,
    const CCoeControl* aParent,
    MEikCommandObserver* aCommandObserver )
    {
    if ( aParent == NULL )
    {
    CreateWindowL();
    }
    else
    {
    SetContainerWindowL( *aParent );
    }
    iFocusControl = NULL;
    iCommandObserver = aCommandObserver;
    InitializeControlsL();
    SetRect( aRect );
    ActivateL();
    }

    TInt CTestContainer2::CountComponentControls() const
    {
    return ( int ) ELastControl;
    }

    CCoeControl* CTestContainer2::ComponentControl( TInt aIndex ) const
    {

    switch (aIndex)
    {
    case EEdit1:
    return iEdit1;
    }

    return NULL;
    }

    void CTestContainer2::SizeChanged()
    {
    CCoeControl::SizeChanged();
    LayoutControls();
    }

    void CTestContainer2::LayoutControls()
    {
    TInt scrollbarWidth = iEdit1->ScrollBarFrame()->ScrollBarBreadth(CEikScrollBar::EVertical);
    TInt editorWidth = Rect().Width() - scrollbarWidth;
    iEdit1->SetExtent( TPoint( 0, 0 ), TSize(editorWidth, Rect().Size().iHeight));
    }

    void CTestContainer2::InitializeControlsL()
    {
    iEdit1 = new ( ELeave ) CEikEdwin;
    iEdit1->SetContainerWindowL( *this );
    {
    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC( reader, R_DVBVIEWER_PROGRAMDETAIL_EDIT1 );
    iEdit1->ConstructFromResourceL( reader );
    CleanupStack::PopAndDestroy(); // reader internal state
    }

    iFocusControl = iEdit1;

    }
    void CTestContainer2::HandleResourceChange( TInt aType )
    {
    TRect rect;
    if ( aType==KEikDynamicLayoutVariantSwitch )
    {
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
    SetRect(rect);
    }

    CCoeControl::HandleResourceChange( aType );
    SetRect( iAvkonViewAppUi->View( TUid::Uid( ETestContainer2ViewId ) )->ClientRect() );

    }

    void CTestContainer2:raw( const TRect& aRect ) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear( aRect );
    }
    ----------------------------------------------------------------


    -------------- TestContainer2.rssi -------------
    RESOURCE AVKON_VIEW r_test_container2_test_container2_view
    {
    cba = R_AVKON_SOFTKEYS_OK_EMPTY;
    menubar = r_test_container2_options_menu;
    toolbar = 0;
    }
    RESOURCE MENU_BAR r_test_container2_options_menu
    {

    }
    RESOURCE STATUS_PANE_APP_MODEL r_test_container2_status_pane
    {
    panes =
    {
    SPANE_PANE
    {
    id = EEikStatusPaneUidTitle;
    type = EAknCtTitlePane;
    resource = r_test_container2_title_resource;
    }
    };
    }
    RESOURCE TITLE_PANE r_test_container2_title_resource
    {
    txt = STR_TestContainer2View_3;
    }


    RESOURCE EDWIN r_dvbviewer_programdetail_edit1
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinDisplayOnly | EEikEdwinReadOnly | EEikEdwinResizable;
    lines = 1;
    maxlength = 3000;
    default_case = EAknEditorTextCase;
    allowed_case_modes = EAknEditorAllCaseModes;
    numeric_keymap = EAknEditorStandardNumberModeKeymap;
    default_input_mode = EAknEditorTextInputMode;
    allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
    avkon_flags = EAknEditorFlagEnableScrollBars | EAknEditorFlagAllowEntersWithScrollDown;
    }
    ------------------------------------------------------

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: touch phone crash when touch option menu

    firstly you should get the panic code: http://wiki.forum.nokia.com/index.ph...ded_panic_code, and secondly you should try finding out on which line it is crashing at.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    6

    Re: touch phone crash when touch option menu

    I ran the application in simulater and got "KERN-EXEC 3"
    But same code work in non-touch phone.

    I do not think there is an unhandled memory problem. Because I do not allocate any resource.
    Just move main view to second view and back to main view.(at that time there is no error)
    When I touch "options" and option menu is displayed and i touch in menu then the phone crashed.

  4. #4
    Regular Contributor
    Join Date
    May 2006
    Posts
    72

    Re: touch phone crash when touch option menu

    Hello All,

    Did you get the solution of this problem . if you got then please guide me because i am getting the same issue this time.

    if any one know about the solution then Please help me.

    it's urgent.

    Regards,
    Ashutosh
    Last edited by ashutosh12; 2010-04-12 at 09:19.

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    6

    Re: touch phone crash when touch option menu

    The problem is here.
    If we delete container class (iTestContainer2), there is a crash
    But I don't know why this is a problem. This is a generated code by carbide
    I think it is a bug in touch phone.

    Any ideas?

    void CTestContainer2View:oDeactivate()
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    CleanupStatusPane();

    if ( iTestContainer2 != NULL )
    {
    AppUi()->RemoveFromViewStack( *this, iTestContainer2 );
    // delete iTestContainer2;
    // iTestContainer2 = NULL;
    }
    // ]]] end generated region [Generated Contents]

    RDebug::Print(_L("view2 deactivated"));
    }

Similar Threads

  1. createImage() exceptions
    By apnasi in forum Mobile Java General
    Replies: 62
    Last Post: 2010-07-24, 16:16
  2. Command gose into the Option Menu.
    By ruhulcool1 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-04-22, 12:06
  3. Replies: 2
    Last Post: 2007-11-10, 13:19
  4. slide menu in j2me
    By afka in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-04, 09:10

Posting Permissions

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