Home > Mobile >  How Android to the layout of the Activity nested fragments in the layout
How Android to the layout of the Activity nested fragments in the layout

Time:10-07

Figure A:

Figure B:


How to figure B (the Activity layout) nested into the figure A layout (fragments) in the red areas

CodePudding user response:

You can use the include tag

CodePudding user response:

I am not going to the XML file directly into fragments, I also operating in the activity, I am want to be in fragments with code to the activity layout sets in

CodePudding user response:

Directly in nested fragments bai fragments

CodePudding user response:

The first thing to understand the significance of using fragments? Previously developed each class is an Activity that quite a waste of resources? If you need to use fragments, then the APP there and only one Activity can;
The meaning of the fragments is fragmented, more to save resources, this was a fragment, you must make the Activity go in? So I think it is not necessary to use fragments, because it doesn't make any sense... Directly with the activty is worse than you, because you don't understand Frament; A pure hand, don't like do not spray;

CodePudding user response:

Activity can be realized, fragments can also realize

CodePudding user response:

Only the activity nested fragments, not the opposite

CodePudding user response:

The
reference 4 floor Fade 龖 龘 response:
must first make clear the significance of using fragments? Previously developed each class is an Activity that quite a waste of resources? If you need to use fragments, then the APP there and only one Activity can;
The meaning of the fragments is fragmented, more to save resources, this was a fragment, you must make the Activity go in? So I think it is not necessary to use fragments, because it doesn't make any sense... Directly with the activty is worse than you, because you don't understand Frament; A pure hand, don't like do not spray;


The injection or injection I met a demand for third-party libraries is the activity, want to be embedded into the now fragments
Less code

CodePudding user response:

The
reference 4 floor Fade 龖 龘 response:
must first make clear the significance of using fragments? Previously developed each class is an Activity that quite a waste of resources? If you need to use fragments, then the APP there and only one Activity can;
The meaning of the fragments is fragmented, more to save resources, this was a fragment, you must make the Activity go in? So I think it is not necessary to use fragments, because it doesn't make any sense... Directly with the activty is worse than you, because you don't understand Frament; A pure hand, don't like do not spray;


APP is, there is only an Activity can be only one or two small demo interface

CodePudding user response:

The activity can't be nested, consider also realize yourself

CodePudding user response:

TabActivity can be achieved, but it's outdated, better to let the product to change the demand again
  • Related