{"id":11942,"date":"2014-07-21T11:24:56","date_gmt":"2014-07-21T08:24:56","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=11942"},"modified":"2019-05-09T11:09:08","modified_gmt":"2019-05-09T08:09:08","slug":"android-framelayout-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/","title":{"rendered":"Android FrameLayout Example"},"content":{"rendered":"<p><a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/FrameLayout.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>FrameLayout<\/code><\/a> represents a simple layout for the user interface of Android applications. It is usually used for displaying single <code>Views<\/code> at a specific area on the screen or overlapping its child views.<\/p>\n<p>In our example we are going to show how you can add and handle <code>FrameLayout<\/code> in your application.<\/p>\n<p>For this tutorial, we will use the following tools in a Windows 64-bit platform:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<ol>\n<li>JDK 1.7<\/li>\n<li>Eclipse 4.2 Juno<\/li>\n<li>Android SDK 4.1<\/li>\n<\/ol>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nYou may skip project creation and jump directly to the <a href=\"#code\"><strong>beginning of the example<\/strong><\/a> below.<\/div>\n<\/p>\n<h2>1. Create a New Android Application Project<\/h2>\n<p>Open Eclipse IDE and go to File \u2192 New \u2192 Project \u2192 Android Application Project.<\/p>\n<p>Specify the name of the application, the project and the package and then click Next.<\/p>\n<p><figure id=\"attachment_11943\" aria-describedby=\"caption-attachment-11943\" style=\"width: 504px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1.png\" alt=\"Figure 1. Create a new Android application\" width=\"504\" height=\"504\" class=\"size-full wp-image-11943\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1.png 504w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1-150x150.png 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1-300x300.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1-200x200.png 200w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1-100x100.png 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj1-42x42.png 42w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><\/a><figcaption id=\"caption-attachment-11943\" class=\"wp-caption-text\">Figure 1. Create a new Android application<\/figcaption><\/figure><\/p>\n<p>In the next window, the \u201cCreate Activity\u201d option should be checked. The new created activity will be the main activity of your project. Then press Next button.<\/p>\n<p><figure id=\"attachment_11944\" aria-describedby=\"caption-attachment-11944\" style=\"width: 504px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2.png\" alt=\"Figure 2. Configure the project\" width=\"504\" height=\"504\" class=\"size-full wp-image-11944\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2.png 504w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2-150x150.png 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2-300x300.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2-200x200.png 200w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2-100x100.png 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestproj2-42x42.png 42w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><\/a><figcaption id=\"caption-attachment-11944\" class=\"wp-caption-text\">Figure 2. Configure the project<\/figcaption><\/figure><\/p>\n<p>In \u201cConfigure Launcher Icon\u201d window you should choose the icon you want to have in your app. We will use the default icon of android, so click Next button.<\/p>\n<p><figure id=\"attachment_11468\" aria-describedby=\"caption-attachment-11468\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_3.png\" alt=\"Figure 3. Configure the launcher icon\" width=\"660\" height=\"590\" class=\"size-full wp-image-11468\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_3.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_3-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-11468\" class=\"wp-caption-text\">Figure 3. Configure the launcher icon<\/figcaption><\/figure><\/p>\n<p>Select the \u201cBlank Activity\u201d option and press Next.<\/p>\n<p><figure id=\"attachment_11469\" aria-describedby=\"caption-attachment-11469\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_4.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_4.png\" alt=\"Figure 4. Create the activity and select its type\" width=\"660\" height=\"590\" class=\"size-full wp-image-11469\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_4.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_4-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-11469\" class=\"wp-caption-text\">Figure 4. Create the activity and select its type<\/figcaption><\/figure><\/p>\n<p>You have to specify a name for the new Activity and a name for the layout description of your app. The .xml file for the layout will automatically be created in the&nbsp;<code>res\/layout<\/code>&nbsp;folder. Finally, press Finish.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><figure id=\"attachment_11470\" aria-describedby=\"caption-attachment-11470\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_5.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_5.png\" alt=\"Figure 5. Create a new blank activity\" width=\"660\" height=\"590\" class=\"size-full wp-image-11470\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_5.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/newproject_5-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-11470\" class=\"wp-caption-text\">Figure 5. Create a new blank activity<\/figcaption><\/figure><\/p>\n<p>Now you can see the final structure of the project in the following image.<\/p>\n<p><figure id=\"attachment_11947\" aria-describedby=\"caption-attachment-11947\" style=\"width: 345px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestStructure.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestStructure.png\" alt=\"Figure 6. The final structure of the project\" width=\"345\" height=\"585\" class=\"size-full wp-image-11947\"><\/a><figcaption id=\"caption-attachment-11947\" class=\"wp-caption-text\">Figure 6. The final structure of the project<\/figcaption><\/figure><\/p>\n<h2><span id=\"code\">2. Create the layout of the Main Activity<\/span><\/h2>\n<p>Now we are going to add <code>FrameLayout<\/code> component to our XML layout file. Open <code>res\/layout\/activity_main.xml<\/code>, go to the respective tab and paste the following code.<\/p>\n<p><em><u>activity_main.xml:<\/u><\/em><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n\n&lt;FrameLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\"\n\tandroid:id=\"@+id\/framelayout\" &gt;\n\t    \n\t&lt;ImageView \n\t\tandroid:id=\"@+id\/frameImage\"\n\t\tandroid:layout_width=\"200dp\"\n\t\tandroid:layout_height=\"300dp\"\n\t\tandroid:src=\"@drawable\/ic_launcher\"\n\t\tandroid:layout_gravity=\"center\"\n\t\tandroid:clickable=\"true\" \/&gt;\n\t    \n\t&lt;TextView\n\t\tandroid:id=\"@+id\/frameText\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"This is a text\"\n\t\tandroid:textSize=\"15sp\"\n\t\tandroid:textStyle=\"bold\" \n\t\tandroid:visibility=\"gone\"\n\t\tandroid:layout_gravity=\"center\" \/&gt;\n\t    \n&lt;\/FrameLayout&gt;\n<\/pre>\n<p>In this example, we include two different <code>Views<\/code> inside the content of the <code>FrameLayout<\/code> and we make them to overlap. The important thing we should mention, is that <code>FrameLayout<\/code> give us the capability to control child element&#8217;s position through <code>layout_gravity<\/code> attribute.<\/p>\n<p>If we want to display only one drawable to the layout, we can use the following XML attributes that <code>FrameLayout<\/code> offers us:<\/p>\n<ul>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/FrameLayout.html#attr_android:foreground\" target=\"_blank\" rel=\"noopener noreferrer\"><code>android:foreground<\/code><\/a>: it is usually used as an overlay and it defines the drawable of the content. The drawable can be specified via a color  or as a reference to another resource.<\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/FrameLayout.html#attr_android:foregroundGravity\" target=\"_blank\" rel=\"noopener noreferrer\"><code>android:foregroundGravity<\/code><\/a>: specifies the gravity of the foreground drawable.<\/li>\n<\/ul>\n<h2>3. Code the Main Activity<\/h2>\n<p>We can also define and set the <code>FrameLayout<\/code> or its child elements through the source code, as you can see in the code below.<\/p>\n<p>Open <code>src\/com.javacodegeeks.android.framelayouttest\/MainActivity.java<\/code>&nbsp;and paste the following code.[ulp id=&#8217;XSQzgZ7lDbTb31Tj&#8217;]<\/p>\n<p><em><u>MainActivity.java:<\/u><\/em><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.framelayouttest;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.graphics.Color;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.FrameLayout;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\npublic class MainActivity extends Activity {\n\n\tprivate ImageView image;\n\tprivate TextView text;\n\tprivate FrameLayout frame;\n\t\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\t\n\t\tframe = (FrameLayout) findViewById(R.id.framelayout);\n\t\ttext = (TextView) findViewById(R.id.frameText);\n\t\timage = (ImageView) findViewById(R.id.frameImage);\n\n\t\t\/\/ add a new element to the FrameLayout\n\t\tTextView newText = new TextView(this);\n\t\tnewText.setText(\"Java Code Geeks!\");\n\t\tnewText.setTextColor(Color.CYAN);\n\t\tnewText.setTextSize(20);\n\t\tframe.addView(newText);\n\t\t\n\t\timage.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\/\/ change the visibility mode of the TextView\n\t\t\t\tif(text.getVisibility() == View.GONE) {\n\t\t\t\t\ttext.setVisibility(View.VISIBLE);\n\t\t\t\t\tframe.setBackgroundColor(Color.MAGENTA);\n\t\t\t\t} else {\n\t\t\t\t\ttext.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}\n\n}\n<\/pre>\n<p>The code above is very simple. We can add a new <code>View<\/code> by calling <code>addView<\/code> function. Also we configure the values of some components (depending on the visibility of the <code>frameText<\/code>), when the image is pressed. Of course Android system provides us a more dynamic way of changing and handling the attributes of application views. As a prerequisite is to map every view with the unique id component of the XML. This can be done via <code>findViewById()<\/code> method.<\/p>\n<h2>4. Run the application<\/h2>\n<p>To run our application, right click on our project \u2192 Run as \u2192 Android Application. The AVD will appear with the app loaded.<\/p>\n<p><figure id=\"attachment_11950\" aria-describedby=\"caption-attachment-11950\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD1.png\" alt=\"Figure 7: The Android app is loaded\" width=\"256\" height=\"359\" class=\"size-full wp-image-11950\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD1.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD1-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-11950\" class=\"wp-caption-text\">Figure 7: The Android app is loaded<\/figcaption><\/figure><\/p>\n<p>As you can see the <code>frameText<\/code> is not displayed on the screen because we configured its visibility to <code>gone<\/code>. But you can notice that another <code>TextView<\/code> is appeared, although we didn&#8217;t define it at the XML layout file. This is happening because we add a new <code>TextView<\/code> element to the <code>FrameLayout<\/code> at the source code.<\/p>\n<p>Now click the image. You can notice that the <code>frameText<\/code> is displayed and it overlaps the image. Also the background color of the <code>FrameLayout<\/code> has changed, as we set it to the <code>MainActivity.java<\/code> file.<\/p>\n<p><figure id=\"attachment_11951\" aria-describedby=\"caption-attachment-11951\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD2.png\" alt=\"Figure 8: The text overlaps (first image click)\" width=\"256\" height=\"359\" class=\"size-full wp-image-11951\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD2.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD2-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-11951\" class=\"wp-caption-text\">Figure 8: The text overlaps (first image click)<\/figcaption><\/figure><\/p>\n<p>When we click the image again, the <code>frameLayout<\/code> disappears because its visibility is set to <code>GONE<\/code> again.<\/p>\n<p><figure id=\"attachment_11952\" aria-describedby=\"caption-attachment-11952\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD3.png\" alt=\"Figure 9: The text is not visible any more (second image click)\" width=\"256\" height=\"359\" class=\"size-full wp-image-11952\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD3.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTestAVD3-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-11952\" class=\"wp-caption-text\">Figure 9: The text is not visible any more (second image click)<\/figcaption><\/figure><\/p>\n<h2>Download the Eclipse Project<\/h2>\n<p>This was an example of FrameLayout in Android.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/FrameLayoutTest.zip\"><strong>FrameLayoutTest.zip<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area on the screen or overlapping its child views. In our example we are going to show how you can add and handle FrameLayout in your application. For this tutorial, we will &hellip;<\/p>\n","protected":false},"author":11,"featured_media":1202,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[535],"tags":[],"class_list":["post-11942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-framelayout"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android FrameLayout Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android FrameLayout Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-21T08:24:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-09T08:09:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Katerina Zamani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Katerina Zamani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\"},\"author\":{\"name\":\"Katerina Zamani\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673\"},\"headline\":\"Android FrameLayout Example\",\"datePublished\":\"2014-07-21T08:24:56+00:00\",\"dateModified\":\"2019-05-09T08:09:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\"},\"wordCount\":752,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"articleSection\":[\"FrameLayout\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\",\"name\":\"Android FrameLayout Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"datePublished\":\"2014-07-21T08:24:56+00:00\",\"dateModified\":\"2019-05-09T08:09:08+00:00\",\"description\":\"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"core\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"widget\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"FrameLayout\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/framelayout\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Android FrameLayout Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673\",\"name\":\"Katerina Zamani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg\",\"caption\":\"Katerina Zamani\"},\"description\":\"Katerina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she attends MSc courses in Advanced Information Systems at the same department. Currently, her main academic interests focus on web applications, mobile development, software engineering, databases and telecommunications.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/katerina-zamani\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android FrameLayout Example - Java Code Geeks","description":"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/","og_locale":"en_US","og_type":"article","og_title":"Android FrameLayout Example - Java Code Geeks","og_description":"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area","og_url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-07-21T08:24:56+00:00","article_modified_time":"2019-05-09T08:09:08+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","type":"image\/jpeg"}],"author":"Katerina Zamani","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Katerina Zamani","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/"},"author":{"name":"Katerina Zamani","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673"},"headline":"Android FrameLayout Example","datePublished":"2014-07-21T08:24:56+00:00","dateModified":"2019-05-09T08:09:08+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/"},"wordCount":752,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","articleSection":["FrameLayout"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/","url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/","name":"Android FrameLayout Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","datePublished":"2014-07-21T08:24:56+00:00","dateModified":"2019-05-09T08:09:08+00:00","description":"FrameLayout represents a simple layout for the user interface of Android applications. It is usually used for displaying single Views at a specific area","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/framelayout\/android-framelayout-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/"},{"@type":"ListItem","position":3,"name":"core","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/"},{"@type":"ListItem","position":4,"name":"widget","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/"},{"@type":"ListItem","position":5,"name":"FrameLayout","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/framelayout\/"},{"@type":"ListItem","position":6,"name":"Android FrameLayout Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673","name":"Katerina Zamani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg","caption":"Katerina Zamani"},"description":"Katerina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she attends MSc courses in Advanced Information Systems at the same department. Currently, her main academic interests focus on web applications, mobile development, software engineering, databases and telecommunications.","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/katerina-zamani\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/11942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=11942"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/11942\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1202"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=11942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=11942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=11942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}