Frame Layout In Android

Frame Layout is one of most use full layout in android . We use FrameLayout when we want to use fragment in out program.

A fragment is usually us as part of an activity user interface and contribute its own layout. To provide layout for the fragment  you just overwrite the the onCreateView() Method which runs when the fragment is called. In the other word fragment is the one kind of the sub activity.


Frame Layout With Example:


  • After that we have to create one other design file for the fragment.


  • After that we have to create the java class for the fragment and we have to extend this class with Fragment ( In this java class we have to overwrite the onCreateView() method and then call the design file through the inflater.

  • After we have do some coding in to replace to our design file with the fragment for which are as below


Frame Layout

Leave a Reply

Your email address will not be published. Required fields are marked *