RelativeLayout layout = findViewById(R.id.relativeLayout); Button button = layout.findViewById(R.id.button); TextView textView = layout.findViewById(R.id.textView);In this example, we have declared a RelativeLayout, and we used the findViewById method to obtain references to Button and TextView UI widgets that were defined in the XML layout file with the IDs (button and textView). A package library for android.widget.RelativeLayout might be android.widget, which contains the basic UI widgets such as buttons, text views, and edit texts.