Set a view as a default view

Context

An application can set a specific registered view as the default view. The default view is displayed when the application is launched or brought to the foreground. Also, a system default view can be set, which is used when an unrecoverable error occurs during view activation or when the application exits.

  • Application default view

    CCoeAppUi::SetDefaultViewL( MCoeView& aView )

    Sets the specified view as the default view for the application. If the application already has the default view set, then the specified view overrides existing default view.

  • System default view.

    • CCoeAppUi::SetSystemDefaultViewL( const TVwsViewId & )

      Sets the system default view for default screen device mode, which is 0.

    • CCoeAppUi::SetSystemDefaultViewL( const TVwsViewId &,TInt )

      Sets the specified view as system default view for a given screen mode.

    Note: An application must have the

    ECapabilityWriteDeviceData capability to set a view as a system default view. If the system default view is already set, then the specified view overrides existing default view.

The following code snippet shows setting a view as the default view for an application:

iCCoeAppUi->SetDefaultViewL( iViewId );