WxAndroid/WXApp

From WxWiki
Jump to: navigation, search

General

WXApp is class, containing references to all objects during application execution. It holds containers like m_viewList and m_actionQueue which purpose is to hold references of all currently existing instances of Views and Activities, and actions to be executed at certain times.
Example would be native code, requests creation of views before there parent frame is created, since it is ran in separate thread. With m_actionQueue action for creating or updating a view is executed on parent's WXFrameActivity onCreate(..).

WXApp also has role of making sure application runs without any Window, and if once Window is requested, it ensures to reference first requested as WXFrameActivity that was created first.

Fields

Field Description
MAIN_ACTIVITY_CREATED Returns if any WXFrameActivity representing wxTopLevelWindow exists. And makes sure native wxStart() is ran only at beginning of application.
MAIN_ACTIVITY Represents first WXFrameActivity, purpose of this is top identify main frame, and last one that helps close application.
m_actionQueue Holds actions that are to be executed on UiThread in every WXFrameActivity creation.
m_viewList Contains ArrayList of WXView. They can be referenced to by there parent's id.
m_frameMap