

{"id":76978,"date":"2020-03-11T09:55:42","date_gmt":"2020-03-11T04:25:42","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=76978"},"modified":"2021-08-25T14:04:13","modified_gmt":"2021-08-25T08:34:13","slug":"android-gridview","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-gridview\/","title":{"rendered":"Android GridView &#8211; Time to list the items in a 2-dimensional way"},"content":{"rendered":"<p>Android GridView layout is one of the very important layouts that we have. It helps us show the data in the form of a grid so that we can show many images or icons at a time. We use this in application to show audios, videos or images from the gallery.<\/p>\n<p>A grid basically shows the list of Items in a <strong>2-Dimensional View<\/strong>. 2-Dimensional View of the list of icons or images is shown in the form of Rows and Columns as in the following Diagram.<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-grid-view.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76876 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-grid-view.jpg\" alt=\"android gridview\" width=\"254\" height=\"359\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-grid-view.jpg 254w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-grid-view-106x150.jpg 106w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-grid-view-212x300.jpg 212w\" sizes=\"auto, (max-width: 254px) 100vw, 254px\" \/><\/a><\/p>\n<p>If the list of item is not fitting in the screen, it automatically becomes scrollable, we don\u2019t need a Scroll view or something with it. Grid is created with the help of <strong>Android GridView<\/strong> that is present in Containers. A grid can be dragged from the list of Containers and dropped on the Screen. To fill the layout with icons or images we need to use <strong>Adapter<\/strong>. An Adapter simply inserts the data in the GridViewby taking the content from the source.<\/p>\n<p><em><strong>Check out how to access data items in android using <a href=\"https:\/\/data-flair.training\/blogs\/android-adapters\/\">Android Adapters<\/a>.<\/strong><\/em><\/p>\n<h2>Attributes of Android GridView<\/h2>\n<p>While we define an Android Gridview, we can also customize it according to our needs and wish. To customize the Grid Layout we use the following <a href=\"https:\/\/developer.android.com\/reference\/org\/xml\/sax\/Attributes\">attributes<\/a>:<\/p>\n<ul>\n<li><strong>android: id &#8211;<\/strong> A Grid needs to be uniquely identified to choose it in case of requirement. For this purpose, id is defined for each grid using this attribute.<\/li>\n<li><strong>android: gravity &#8211;<\/strong> This attribute sets the alignment of the GridView. We can align a Grid using, left, right, below, etc.<\/li>\n<li><strong>android: columnWidth &#8211;<\/strong> This attribute is used to set the width of the Column to a fixed size using dp, sp, px, in or mm.<\/li>\n<li><strong>android: stretchMode &#8211;<\/strong> stretchMode attribute is used to stretch and fill the empty space in a cell if any. The values that it may hold are &#8211; none, spacingWidth, columnWidth, spacingwidthUniform.<\/li>\n<li><strong>android: horizontalSpacing &#8211;<\/strong> This attribute defines the spacing between the columns. The spacing could be in dp, sp, px, in or mm.<\/li>\n<li><strong>android: numColumns &#8211;<\/strong> This attribute defines the number of icons or images that can be arranged in a column.<\/li>\n<li><strong>android: height &#8211;<\/strong> This attribute sets the height of the Android GridView in dp, sp, px, in or mm.<\/li>\n<li><strong>android: width &#8211;<\/strong> This attribute sets the width of the GridView in dp, sp, px, in or mm.<\/li>\n<li><strong>android: verticalSpacing &#8211;<\/strong> This attribute defines the spacing between the rows. The spacing could be in dp, sp, px, in or mm.<\/li>\n<\/ul>\n<h3>How to Implement GridView in Android?<\/h3>\n<p>Now it is the time to implement an Android GridView example to see how we can arrange the images in Grid form. Lets us begin with the following step by step process.<\/p>\n<p><strong>Step 1:<\/strong> First of all we will create a new project and name it. Then we will define the Android GridView in <strong>activiy_main.xml<\/strong> file as follow:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;GridView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n   android:id=\"@+id\/mygrid\"\r\n   android:layout_width=\"match_parent\"\r\n   android:layout_height=\"match_parent\"\r\n   android:columnWidth=\"110dp\"\r\n   android:numColumns=\"auto_fit\"\r\n   android:stretchMode=\"columnWidth\"\r\n   android:verticalSpacing=\"15dp\"\r\n   android:horizontalSpacing=\"15dp\"\r\n   android:gravity=\"center\" \/&gt;<\/pre>\n<p><strong>Step 2:<\/strong> After this, we will now create a file named, <strong>SetImageAdapter.java<\/strong> file. We will create it in the same folder, where we have <strong>MainActivity.java<\/strong> file. Now, we will write the following code in <strong>SetImageAdapter.java<\/strong>\u00a0file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.DataFlair.mycats;\r\n\r\nimport android.content.Context;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.widget.BaseAdapter;\r\nimport android.widget.GridView;\r\nimport android.widget.ImageView;\r\n\r\npublic class SetImageAdapter extends BaseAdapter {\r\n   public Integer[] thumbImages = {\r\n           R.drawable.img1, R.drawable.img2,\r\n           R.drawable.img11, R.drawable.img12,\r\n           R.drawable.img3, R.drawable.img13,\r\n           R.drawable.img4, R.drawable.img9,\r\n           R.drawable.img5, R.drawable.img8,\r\n           R.drawable.img1, R.drawable.img1,\r\n           R.drawable.img6, R.drawable.img7,\r\n           R.drawable.img11, R.drawable.img10,\r\n           R.drawable.img1, R.drawable.img2,\r\n           R.drawable.img5, R.drawable.img8,\r\n           R.drawable.img1, R.drawable.img1,\r\n           R.drawable.img6, R.drawable.img7,\r\n           R.drawable.img11, R.drawable.img10,\r\n           R.drawable.img1, R.drawable.img2,\r\n           R.drawable.img11, R.drawable.img12,\r\n           R.drawable.img3, R.drawable.img13,\r\n           R.drawable.img4, R.drawable.img9,\r\n           R.drawable.img5, R.drawable.img8,\r\n           R.drawable.img1, R.drawable.img1,\r\n           R.drawable.img6, R.drawable.img7\r\n   };\r\n   private Context Cont;\r\n\r\n   public SetImageAdapter(Context c) {\r\n       Cont = c;\r\n   }\r\n\r\n   public int getCount() {\r\n       return thumbImages.length;\r\n   }\r\n\r\n   public Object getItem(int position) {\r\n       return null;\r\n   }\r\n\r\n   public long getItemId(int position) {\r\n       return 0;\r\n   }\r\n\r\n   public View getView(int position, View convertView, ViewGroup parent) {\r\n       ImageView imgview = new ImageView(Cont);\r\n       imgview.setLayoutParams(new GridView.LayoutParams(370, 250));\r\n       imgview.setScaleType(ImageView.ScaleType.CENTER_CROP);\r\n       imgview.setPadding(10,10,10, 10);\r\n       imgview.setImageResource(thumbImages[position]);\r\n       return imgview;\r\n   }\r\n}<\/pre>\n<p><strong>Step 3:<\/strong> Now we will write the following code in the <strong>MainActivity.java<\/strong> file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.DataFlair.mycats;\r\n\r\nimport android.os.Bundle;\r\nimport android.widget.GridView;\r\n\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.activity_main);\r\n       GridView gv = findViewById(R.id.mygrid);\r\n       gv.setAdapter(new SetImageAdapter(this));\r\n\r\n   }\r\n}<\/pre>\n<p><strong>Step 4:<\/strong> After that, we will run the app following would be shown on the Screen:<\/p>\n<p><strong>i)<\/strong> This is the GridView.<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/GridView.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76981 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/GridView.jpg\" alt=\"gridview in android\" width=\"300\" height=\"533\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/GridView.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/GridView-84x150.jpg 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/GridView-169x300.jpg 169w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>ii)<\/strong> Here I have added many images to show you how it becomes scrollable. To see that consider the following video:<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/grid.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-77015 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/grid.gif\" alt=\"gridview in android gif\" width=\"332\" height=\"696\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this article, we saw the concept of Android Grid View and how important it is to arrange and show the icons in a systematic way. We also saw how we can define Android GridView and customize it. In the end, we have also implemented an example of Android GridView. So we will meet in the next article.<\/p>\n<p>If you liked DataFlair&#8217;s Android GridView article, do rate us on <a href=\"https:\/\/g.page\/DataFlair\/review?kd\"><em><strong>Google<\/strong><\/em><\/a>.<\/p>\n<p>Happy Learning\ud83d\ude03<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1145,&quot;href&quot;:&quot;https:\\\/\\\/developer.android.com\\\/reference\\\/org\\\/xml\\\/sax\\\/Attributes&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250902145547\\\/https:\\\/\\\/developer.android.com\\\/reference\\\/org\\\/xml\\\/sax\\\/Attributes&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 01:55:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-12 04:05:39&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-15 07:12:59&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-18 17:41:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-22 06:57:59&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-25 20:27:45&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-29 09:57:39&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-01 18:38:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-04 19:46:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-09 10:02:50&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-12 17:43:05&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-16 07:18:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-19 09:53:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-22 10:56:27&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-26 02:47:13&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-29 04:48:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-01 21:34:58&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-05 02:23:42&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-08 05:38:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-11 11:09:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-14 15:19:24&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-18 17:04:05&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-23 05:10:31&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-26 17:17:04&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-02 07:56:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-06 11:19:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-09 14:21:41&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-13 11:28:45&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-16 16:15:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-19 17:26:37&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-23 06:14:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-26 10:55:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-29 19:30:05&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-02 04:35:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-05 08:08:51&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-09 12:13:21&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-13 07:26:38&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-17 00:04:41&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-20 11:07:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-24 14:54:43&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-28 08:30:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-02 16:13:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-06 23:08:33&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-11 03:53:44&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-14 09:58:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-17 11:19:46&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-21 05:52:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-25 08:09:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-28 12:38:51&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-01 14:06:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-05 08:45:38&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-08 14:35:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-14 09:45:21&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-14 09:45:21&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:1144,&quot;href&quot;:&quot;https:\\\/\\\/g.page\\\/DataFlair\\\/review?kd&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/g.page\\\/DataFlair\\\/review\\\/?kd&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android GridView layout is one of the very important layouts that we have. It helps us show the data in the form of a grid so that we can show many images or icons&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":77010,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[22105,22109,22106,22108,22107],"class_list":["post-76978","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-gridview","tag-android-gridview-example","tag-attributes-of-android-gridview","tag-gridview-in-android","tag-how-to-implement-gridview-in-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android GridView - Time to list the items in a 2-dimensional way - DataFlair<\/title>\n<meta name=\"description\" content=\"Know how to show your data in the form of a grid using Android GridView. Also, learn to implement GridView in Android with the help of examples and explore its various attributes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/android-gridview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android GridView - Time to list the items in a 2-dimensional way - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Know how to show your data in the form of a grid using Android GridView. Also, learn to implement GridView in Android with the help of examples and explore its various attributes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-gridview\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-11T04:25:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:34:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android GridView - Time to list the items in a 2-dimensional way - DataFlair","description":"Know how to show your data in the form of a grid using Android GridView. Also, learn to implement GridView in Android with the help of examples and explore its various attributes.","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:\/\/data-flair.training\/blogs\/android-gridview\/","og_locale":"en_US","og_type":"article","og_title":"Android GridView - Time to list the items in a 2-dimensional way - DataFlair","og_description":"Know how to show your data in the form of a grid using Android GridView. Also, learn to implement GridView in Android with the help of examples and explore its various attributes.","og_url":"https:\/\/data-flair.training\/blogs\/android-gridview\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-03-11T04:25:42+00:00","article_modified_time":"2021-08-25T08:34:13+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Android GridView &#8211; Time to list the items in a 2-dimensional way","datePublished":"2020-03-11T04:25:42+00:00","dateModified":"2021-08-25T08:34:13+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/"},"wordCount":661,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg","keywords":["Android GridView","Android GridView Example","Attributes of Android GridView","GridView in Android","How to Implement GridView in Android?"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-gridview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/","url":"https:\/\/data-flair.training\/blogs\/android-gridview\/","name":"Android GridView - Time to list the items in a 2-dimensional way - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg","datePublished":"2020-03-11T04:25:42+00:00","dateModified":"2021-08-25T08:34:13+00:00","description":"Know how to show your data in the form of a grid using Android GridView. Also, learn to implement GridView in Android with the help of examples and explore its various attributes.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-gridview\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/android-gridview.jpg","width":802,"height":420,"caption":"gridview in android"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-gridview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Android Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/android\/"},{"@type":"ListItem","position":3,"name":"Android GridView &#8211; Time to list the items in a 2-dimensional way"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=76978"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76978\/revisions"}],"predecessor-version":[{"id":77016,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76978\/revisions\/77016"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/77010"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=76978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=76978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=76978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}