Browse Source

android onAppear

Daniel Zlotin 7 years ago
parent
commit
ce47fb3d90

+ 4
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.java View File

14
 	private final String id;
14
 	private final String id;
15
 	private View view;
15
 	private View view;
16
 	private StackController parentStackController;
16
 	private StackController parentStackController;
17
+	private boolean appeared = false;
17
 
18
 
18
 	public ViewController(Activity activity, String id) {
19
 	public ViewController(Activity activity, String id) {
19
 		this.activity = activity;
20
 		this.activity = activity;
67
 
68
 
68
 	@Override
69
 	@Override
69
 	public void onGlobalLayout() {
70
 	public void onGlobalLayout() {
70
-		if (getView().isShown())
71
+		if (!appeared && getView().isShown()) {
72
+			appeared = true;
71
 			onAppear();
73
 			onAppear();
74
+		}
72
 	}
75
 	}
73
 }
76
 }