Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates. Last updated 2019-12-27 UTC.
BuildAI experiences BuildAI-powered Android apps with Gemini APIs and more. Get started Start by creating your first app. Go deeper with our training courses or explore app development on your own.
I know how to get the root view with View.getRootView(). I am also able to get the view from a button's onClick event where the argument is a View. But how can I get the view in an activity?