mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Refactored getting root view in android (#4463)
This commit is contained in:
@@ -185,7 +185,7 @@ function initLifecycleCallbacks() {
|
|||||||
androidApp.notify(<AndroidActivityBundleEventData>{ eventName: ActivityCreated, object: androidApp, activity, bundle: savedInstanceState });
|
androidApp.notify(<AndroidActivityBundleEventData>{ eventName: ActivityCreated, object: androidApp, activity, bundle: savedInstanceState });
|
||||||
|
|
||||||
if (hasListeners(displayedEvent)) {
|
if (hasListeners(displayedEvent)) {
|
||||||
let rootView = activity.findViewById((<any>android).R.id.content);
|
const rootView = activity.getWindow().getDecorView().getRootView();
|
||||||
let onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({
|
let onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({
|
||||||
onGlobalLayout() {
|
onGlobalLayout() {
|
||||||
notify({ eventName: displayedEvent, object: androidApp, activity });
|
notify({ eventName: displayedEvent, object: androidApp, activity });
|
||||||
|
|||||||
Reference in New Issue
Block a user