ソースを参照

Fix no buttons bug for first screen

Due to race condition between SetupToolbarButtonsTask and
onCreateOptionsMenu buttons did not get set for first pushed screen.
In order to set buttons we need a ref to Menu which is set in
onCreateOptionsMenu. Sometimes onCreateOptionsMenu got called after
onCreate of our activity where we setup the toolbar.
Guy Carmeli 8 年 前
コミット
ecb6588f62
共有1 個のファイルを変更した3 個の追加0 個の削除を含む
  1. 3
    0
      android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java ファイルの表示

@@ -258,6 +258,9 @@ public abstract class BaseReactActivity extends AppCompatActivity implements Def
258 258
     @Override
259 259
     public boolean onCreateOptionsMenu(Menu menu) {
260 260
         mMenu = menu;
261
+        if (mToolbar != null) {
262
+            mToolbar.setupToolbarButtonsAsync(getCurrentScreen());
263
+        }
261 264
         return super.onCreateOptionsMenu(menu);
262 265
     }
263 266