Why Fragments, and when to use Fragments instead of Activities?
Why Fragments, and when to use Fragments instead of Activities?
Here is a detailed answer to your Android interview question about Fragments:
Fragments were introduced in Android 3.0 (Honeycomb) to provide a modular approach to building Android user interfaces. Fragments allow you to encapsulate a portion of the UI and its behavior into reusable, self-contained components. This provides several key benefits:
Here are some common scenarios where using Fragments is preferred over using Activities:
Multi-pane layouts: When building tablet-optimized layouts with multiple panes of content, Fragments allow you to easily manage and combine these panes within a single Activity.
Master-detail flows: For apps that display a list of items (master) and a detailed view of the selected item (det...
middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào