findViewById(): only search among child views

also set default content view in Window
This commit is contained in:
Julian Winkler
2024-02-11 12:33:58 +01:00
parent d2f28a5b21
commit d253bfd24f
4 changed files with 24 additions and 8 deletions

View File

@@ -28,6 +28,8 @@ public class Window {
public Window(Window.Callback callback) {
this.callback = callback;
contentView = new ViewGroup(Context.this_application);
contentView.setId(android.R.id.content);
}
public void addFlags(int flags) {}
@@ -66,7 +68,10 @@ public class Window {
}
public View findViewById(int id) {
return View.view_by_id.get(id);
if (contentView != null)
return contentView.findViewById(id);
else
return null;
}
public View peekDecorView() {