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

@@ -239,7 +239,9 @@ public class Activity extends ContextWrapper implements Window.Callback {
public <T extends android.view.View> T findViewById(int id) {
System.out.println("- findViewById - asked for view with id: " + id);
View view = View.view_by_id.get(id);
View view = null;
if (window.contentView != null)
view = window.contentView.findViewById(id);
System.out.println("- findViewById - found this: " + view);
return (T)view;