Engaged Employer
Provide an implementation for View findViewById(ViewGroup root, int id) using ViewGroup and View
Anonymous
ViewGroup root = (ViewGroup) getWindow().getDecorView().getRootView(); TextView textView = (TextView) findViewById(root, R.id.text); textView.setText("Found " + textView.getText()); private View findViewById(ViewGroup root, int id) { if (root.getId() == id) return root; for (int i = 0; i < root.getChildCount(); i++) { View child = root.getChildAt(i); if (child.getId() == id) return child; if (child instanceof ViewGroup) { View view = findViewById((ViewGroup) child, id); if (view != null) return view; } } return null; }
Check out your Company Bowl for anonymous work chats.