Home > Mobile > Android ever like GroupBox in other programming languages or Panel controls?
Android ever like GroupBox in other programming languages or Panel controls?
Time:11-26
In other programming languages, such as Delphi, c #, etc., have a GroupBox, Panel, or TabSheet, put many controls can be used as a container for the developers, then according to the conditions set which container can be seen, very convenient to get data,
In the AS, seems not to have these things, only fragments seems to act AS the role (need to cooperate TabLayout, ViewPager), but the fragments and the main Activity by value and very trouble, such AS the need to each Fragment there is a value used to trigger the button, but not my fragments inside button, only the Activity have a save button, and how to pass the value?
I am AS a novice, there are a lot of immature ideas, please don't joke, have a good solution, please give directions, thank you very much!
CodePudding user response:
See a lot of online posts, are there is a value used to trigger the action in fragments of button, the save button above, for example, means to inform the main Activity: I have completed the information collection, now send a value to you, please receive, as without the trigger action, the values in the main Activity can't get fragments!
However, there is a button in each Fragment, feel redundant, I don't need, because the Lord confirm button in the Activity, can judge which one is currently fragments, and then use any way to get the value of the inside, I don't know what to do,
CodePudding user response:
CodePudding user response:
All the layout is written to the activity you are ok, why write separately