Android

Android UI and Resources

Views, Layouts, RecyclerView, resources and internationalization

30 Interview-Fragen·
Junior
1

What is the difference between View and ViewGroup?

Antwort

View is the base class for all UI components (Button, TextView, ImageView, etc.). ViewGroup is a subclass of View that contains other Views (or ViewGroups). ViewGroups are layout containers: LinearLayout, RelativeLayout, ConstraintLayout, FrameLayout, etc.

2

What is the LayoutInflater?

Antwort

LayoutInflater is used to convert an XML layout file into corresponding View objects. It's essential in onCreate() with setContentView(), in Adapters to create list items, and in Fragments. Method: LayoutInflater.from(context).inflate(R.layout.my_layout, parent, false).

3

Which Layout organizes Views in horizontal or vertical line?

Antwort

LinearLayout organizes its children in a single line (horizontal with android:orientation='horizontal' or vertical with 'vertical'). It's the simplest layout. You can control distribution with layout_weight to distribute available space.

4

Which Layout allows positioning Views relative to each other?

5

Which Layout is recommended by Google for complex interfaces?

+27 Interview-Fragen

Meistere Android für dein nächstes Interview

Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.

Kostenlos starten