Skip to content

Commit b6e6e84

Browse files
committed
Add a helper method to help apps to perform pre render action on root component
1 parent 6a6f234 commit b6e6e84

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeBaseActivity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private NavigationLaunchConfig createNavLaunchConfigInternal() {
145145
@CallSuper
146146
protected void onCreate(Bundle savedInstanceState) {
147147
super.onCreate(savedInstanceState);
148+
preRootComponentRender();
148149
if (mainLayout() != NONE) {
149150
setContentView(mainLayout());
150151
}
@@ -156,6 +157,14 @@ protected void onCreate(Bundle savedInstanceState) {
156157
setupNavBar();
157158
}
158159

160+
/**
161+
* Override this to perform any action that needs to be performed before the root component is first rendered.
162+
* Some apps might only choose to initialize the container inside an activity. This method can act as a helper method for them to perform init.
163+
*/
164+
protected void preRootComponentRender() {
165+
// Do nothing here, override if needed.
166+
}
167+
159168
@Override
160169
protected void onDestroy() {
161170
super.onDestroy();

0 commit comments

Comments
 (0)