Are android fragments similar to iframes in HTML?

I understand that android is a completely different matter than browser programming. But, based on the background of web development, I wanted to determine which fragments should be used? Are they similar to the iframes concept in an HTML page with its own user interface and can be added to any other page?

If not, then what is the common use case for android fragments?

+4
source share
2 answers

They are reusable parts of your applications. For example, you can use two different operations using the same fragment. You can read the Design Philosophy snippets in the Android documentation.

Here is also a brief description from the same documentation page:

A snippet is a behavior or part of the user interface in an Event. You can combine several fragments in one action with create a multi-level interface and reuse a fragment in several actions. You can imagine a fragment as a modular section of an activity that has its own life cycle, receives its own input events, and which you can add or remove while working (sort of like a “sub activity" that you can use in different actions).

0
source

Yes, I think you can think of them as the same at a conceptual level.

0
source

Source: https://habr.com/ru/post/1414681/


All Articles