{"id":39080,"date":"2016-07-11T11:00:15","date_gmt":"2016-07-11T08:00:15","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=39080"},"modified":"2019-04-24T11:32:11","modified_gmt":"2019-04-24T08:32:11","slug":"android-stackview-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/","title":{"rendered":"Android StackView Example"},"content":{"rendered":"<p>The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the front view-item can be flipped to give room for the item after it. The StackView collection may be found in several widgets, because of its view behaviour.<\/p>\n<p>Generally, StackView is an AdapterView thus working with StackView is not significantly different than is working with any other AdapterView. You create an Adapter defining the contents (in this case, defining the cards), you attach the Adapter to the StackView, and put the StackView somewhere on the screen. However StackView seems to work best with children that have explicit sizes.<\/p>\n<p>In this example we are going to see how to design and implement a simple Android StackView.&nbsp;For this example we are using the following tools in a Windows 64-bit or an OS X platform:<\/p>\n<ul>\n<li>JDK 1.7<\/li>\n<li>Android Studio 2.1.2<\/li>\n<li>Android SDK 6.0<\/li>\n<\/ul>\n<p>Let\u2019s take a closer look:\n<\/p>\n<h2>1. Create a New Android Studio Project<\/h2>\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>Open Android Studio and choose \u201cStart a new Android Studio Project\u201d in the welcome screen.<\/p>\n<p><figure id=\"attachment_27646\" aria-describedby=\"caption-attachment-27646\" style=\"width: 797px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs1.png\"><img decoding=\"async\" class=\"size-full wp-image-27646\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs1.png\" alt=\"\u201cWelcome to Android Studio\u201d screen. Choose \u201cStart a new Android Studio Project\u201d.\" width=\"797\" height=\"601\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs1.png 797w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs1-300x226.png 300w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a><figcaption id=\"caption-attachment-27646\" class=\"wp-caption-text\">\u201cWelcome to Android Studio\u201d screen. Choose \u201cStart a new Android Studio Project\u201d.<\/figcaption><\/figure><\/p>\n<p>Specify the name of the application, the project and the package.<\/p>\n<p><figure id=\"attachment_39089\" aria-describedby=\"caption-attachment-39089\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview1.png\"><img decoding=\"async\" class=\"size-full wp-image-39089\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview1.png\" alt=\"\u201cConfigure your new project\u201d screen. Add your application name and the projects package name.\" width=\"800\" height=\"519\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview1.png 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview1-300x195.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview1-768x498.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-39089\" class=\"wp-caption-text\">\u201cConfigure your new project\u201d screen. Add your application name and the projects package name.<\/figcaption><\/figure><\/p>\n<p>In the next window, select the form factors your app will run on.<\/p>\n<p><figure id=\"attachment_27648\" aria-describedby=\"caption-attachment-27648\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs3.png\"><img decoding=\"async\" class=\"size-full wp-image-27648\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs3.png\" alt=\"\u201cTarget Android Devices\u201d screen.\" width=\"800\" height=\"512\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs3.png 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioexs3-300x192.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-27648\" class=\"wp-caption-text\">\u201cTarget Android Devices\u201d screen.<\/figcaption><\/figure><\/p>\n<p>In the next window you should choose to \u201cAdd an activity to Mobile\u201d. In our example, we will choose to create a project with no activity, so choose: \u201cAdd no activity\u201d.<\/p>\n<p><figure id=\"attachment_27650\" aria-describedby=\"caption-attachment-27650\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioex4.png\"><img decoding=\"async\" class=\"size-full wp-image-27650\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioex4.png\" alt=\"\u201cAdd an activity to Mobile\u201d. Choose: \u201cAdd no activity\u201d.\" width=\"800\" height=\"512\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioex4.png 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/10\/androidstudioex4-300x192.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-27650\" class=\"wp-caption-text\">\u201cAdd an activity to Mobile\u201d. Choose: \u201cAdd no activity\u201d.<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Now press finish, and our project has just been created!<\/p>\n<h2>2. Create the layout of the AndroidStackViewActivity<\/h2>\n<p>Add a new xml file inside <code>\/res\/layout<\/code> folder, with name <code>activity_main.xml<\/code>. We should have <code>\/layout\/activity_main.xml<\/code> file and paste the code below.<\/p>\n<p><em><span style=\"text-decoration: underline;\">activity_main.xml<\/span><\/em><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#ffcc00\"&gt;\n\n    &lt;StackView\n        android:id=\"@+id\/stack_view\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:animateLayoutChanges=\"true\"&gt;&lt;\/StackView&gt;\n\n&lt;\/RelativeLayout&gt;\n<\/pre>\n<h2>3. Create the layout of the StackView items<\/h2>\n<p>Add a new xml file inside <code>\/res\/layout<\/code> folder, with name <code>item.xml<\/code>. We should have <code>\/layout\/item.xml<\/code> file and paste the code below.<\/p>\n<p><em><span style=\"text-decoration: underline;\">item.xml<\/span><\/em><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;FrameLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"#454545\"&gt;\n\n    &lt;ImageView\n        android:id=\"@+id\/image\"\n        android:layout_width=\"420dp\"\n        android:layout_height=\"300dp\"\n        android:layout_centerHorizontal=\"true\" \/&gt;\n\n&lt;\/FrameLayout&gt;\n<\/pre>\n<h2>4. Create the source code of the StackItems<\/h2>\n<p>Add a new Java class inside src\/com.javacodegeeks.AndroidStackViewExample\/ so that we are going to have the src\/com.javacodegeeks.AndroidStackViewExample\/StackItems.java file and paste the code below.<\/p>\n<p><em><span style=\"text-decoration: underline;\">StackItems.java<\/span><\/em><\/p>\n<pre class=\"brush:java; wrap-lines:false\">package com.javacodegeeks.AndroidStackViewExample;\n\npublic class StackItems {\n    Integer image;\n\n    public StackItems(String name, Integer image) {\n        this.image = image;\n    }\n\n    public int getImage() {\n        return image;\n    }\n\n}\n<\/pre>\n<h2>5. Create the source code of the StackAdapter<\/h2>\n<p>Add a new Java class inside <code>src\/com.javacodegeeks.AndroidStackViewExample\/<\/code> so that we are going to have the <code>src\/com.javacodegeeks.AndroidStackViewExample\/StackItems.java<\/code> file and paste the code below.<\/p>\n<p><em><span style=\"text-decoration: underline;\">StackAdapter.java<\/span><\/em><\/p>\n<pre class=\"brush:java; wrap-lines:false\">package com.javacodegeeks.AndroidStackViewExample;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.ImageView;\n\nimport java.util.ArrayList;\n\npublic class StackAdapter extends BaseAdapter {\n\n    ArrayList arrayList;\n    LayoutInflater inflater;\n    ViewHolder holder = null;\n\n    public StackAdapter(Context context, ArrayList arrayList) {\n        this.arrayList = arrayList;\n        this.inflater = LayoutInflater.from(context);\n    }\n\n    @Override\n    public int getCount() {\n        return arrayList.size();\n    }\n\n    @Override\n    public StackItems getItem(int pos) {\n        return arrayList.get(pos);\n    }\n\n    @Override\n    public long getItemId(int pos) {\n        return pos;\n    }\n\n    @Override\n    public View getView(int pos, View view, ViewGroup parent) {\n        if (view == null) {\n            view = inflater.inflate(R.layout.item, parent, false);\n            holder = new ViewHolder();\n            holder.image = (ImageView) view.findViewById(R.id.image);\n            view.setTag(holder);\n        } else {\n            holder = (ViewHolder) view.getTag();\n        }\n        holder.image.setBackgroundResource(arrayList.get(pos).getImage());\n\n        return view;\n    }\n\n    public class ViewHolder {\n        ImageView image;\n    }\n\n}\n<\/pre>\n<h2>6. Create the source code of the AndroidStackViewActivity<\/h2>\n<p>Add a new Java class inside <code>src\/com.javacodegeeks.AndroidStackViewExample\/<\/code> so that we are going to have the <code>src\/com.javacodegeeks.AndroidStackViewExample\/AndroidStackViewActivity.java<\/code> file and paste the code below.[ulp id=&#8217;Ja8Orb5oPKdShcXt&#8217;]<\/p>\n<p><em><span style=\"text-decoration: underline;\">AndroidStackViewActivity.java<\/span><\/em><\/p>\n<pre class=\"brush:java; wrap-lines:false\">package com.javacodegeeks.AndroidStackViewActivity;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.StackView;\n\nimport java.util.ArrayList;\n\npublic class AndroidStackViewActivity extends Activity {\n\n    private static StackView stackView;\n    private static ArrayList list;\n\n    private static final Integer[] icons = {R.drawable.jellybean, R.drawable.kitkat,\n            R.drawable.lollipop, R.drawable.marshmellow, R.drawable.nougat};\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        stackView = (StackView) findViewById(R.id.stack_view);\n        list = new ArrayList();\n\n        for (int i = 0; i &lt; icons.length; i++) {\n            list.add(new StackItems(\"Item \" + i, icons[i]));\n        }\n        StackAdapter adapter = new StackAdapter(AndroidStackViewActivity.this, list);\n        stackView.setAdapter(adapter);\n        adapter.notifyDataSetChanged();\n    }\n}\n<\/pre>\n<h2>7. AndroidManifest.xml<\/h2>\n<p>The AndroidManifest.xml of our project has no special permissions.<\/p>\n<p><em><span style=\"text-decoration: underline;\"> AndroidManifest.xml<\/span><\/em><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    package=\"com.javacodegeeks.AndroidStackViewExample\"&gt;\n\n    &lt;application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap\/ic_launcher\"\n        android:label=\"@string\/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style\/AppTheme\"&gt;\n        &lt;activity\n            android:name=\".AndroidStackViewActivity\"\n            android:label=\"@string\/app_name\"\n            android:screenOrientation=\"portrait\"&gt;\n            &lt;intent-filter&gt;\n                &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\n                &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\n            &lt;\/intent-filter&gt;\n        &lt;\/activity&gt;\n    &lt;\/application&gt;\n&lt;\/manifest\n&gt;\n<\/pre>\n<h2>8. build.gradle<\/h2>\n<p>The build.gradle of our project is simple.<\/p>\n<p><em><span style=\"text-decoration: underline;\"> build.gradle<\/span><\/em><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.2\"\n\n    defaultConfig {\n        applicationId \"com.javacodegeeks.AndroidStackViewExample\"\n        minSdkVersion 15\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support:appcompat-v7:23.4.0'\n}\n<\/pre>\n<h2>9. Build, compile and run<\/h2>\n<p>When we build, compile and run our project, the main AndroidStackViewActivity should look like this:<\/p>\n<p><figure id=\"attachment_39090\" aria-describedby=\"caption-attachment-39090\" style=\"width: 400px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview3.png\"><img decoding=\"async\" class=\"size-full wp-image-39090\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview3.png\" alt=\"This is how our application looks.\" width=\"400\" height=\"711\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview3.png 400w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/androidstackview3-169x300.png 169w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><figcaption id=\"caption-attachment-39090\" class=\"wp-caption-text\">This is how our application looks.<\/figcaption><\/figure><\/p>\n<h2>10. Download the Android Studio Project<\/h2>\n<p>This was an example of Android StackView.<\/p>\n<div class=\"download\"><strong>Download<br \/>\n<\/strong>You can download the full source code of this example here:&nbsp;<a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/AndroidStackViewExample.zip\"><strong>AndroidStackViewExample<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the front view-item can be flipped to give room for the item after it. The StackView collection may be found in several widgets, because of its view behaviour. Generally, StackView is an AdapterView &hellip;<\/p>\n","protected":false},"author":14,"featured_media":1202,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1531],"tags":[173,1529,1227,1530],"class_list":["post-39080","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stackview","tag-android-2","tag-android-stackview","tag-android-studio","tag-android-widgets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android StackView Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the\" \/>\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\/stackview\/android-stackview-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android StackView Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-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=\"2016-07-11T08:00:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-24T08:32:11+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=\"Chryssa Aliferi\" \/>\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=\"Chryssa Aliferi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 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\/stackview\/android-stackview-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/\"},\"author\":{\"name\":\"Chryssa Aliferi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/863144453b9fc15d4184d71833dcf332\"},\"headline\":\"Android StackView Example\",\"datePublished\":\"2016-07-11T08:00:15+00:00\",\"dateModified\":\"2019-04-24T08:32:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/\"},\"wordCount\":569,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"keywords\":[\"android\",\"android stackview\",\"Android Studio\",\"android widgets\"],\"articleSection\":[\"StackView\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/\",\"name\":\"Android StackView Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"datePublished\":\"2016-07-11T08:00:15+00:00\",\"dateModified\":\"2019-04-24T08:32:11+00:00\",\"description\":\"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-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\/stackview\/android-stackview-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\":\"StackView\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/stackview\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Android StackView 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\/863144453b9fc15d4184d71833dcf332\",\"name\":\"Chryssa Aliferi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/03\/Chryssa-Aliferi-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/03\/Chryssa-Aliferi-96x96.jpg\",\"caption\":\"Chryssa Aliferi\"},\"description\":\"Chryssa is a Computer Science graduate from Athens University of Economic and Business. During her studies, Chryssa carried out a great variety of projects ranging from networking to software engineering. She is very keen on front end development especially on mobile technologies and web applications. She has worked as a junior Software Engineer in the telecommunications area and currently works as an Android Developer.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/chryssa-aliferi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android StackView Example - Java Code Geeks","description":"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the","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\/stackview\/android-stackview-example\/","og_locale":"en_US","og_type":"article","og_title":"Android StackView Example - Java Code Geeks","og_description":"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the","og_url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-07-11T08:00:15+00:00","article_modified_time":"2019-04-24T08:32:11+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":"Chryssa Aliferi","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Chryssa Aliferi","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/"},"author":{"name":"Chryssa Aliferi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/863144453b9fc15d4184d71833dcf332"},"headline":"Android StackView Example","datePublished":"2016-07-11T08:00:15+00:00","dateModified":"2019-04-24T08:32:11+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/"},"wordCount":569,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","keywords":["android","android stackview","Android Studio","android widgets"],"articleSection":["StackView"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/","url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/","name":"Android StackView Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","datePublished":"2016-07-11T08:00:15+00:00","dateModified":"2019-04-24T08:32:11+00:00","description":"The Honeycomb Android version, introduced some interesting widgets with collections. One of them is the Android StackView, a stacked card view where the","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/stackview\/android-stackview-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\/stackview\/android-stackview-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":"StackView","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/stackview\/"},{"@type":"ListItem","position":6,"name":"Android StackView 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\/863144453b9fc15d4184d71833dcf332","name":"Chryssa Aliferi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/03\/Chryssa-Aliferi-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/03\/Chryssa-Aliferi-96x96.jpg","caption":"Chryssa Aliferi"},"description":"Chryssa is a Computer Science graduate from Athens University of Economic and Business. During her studies, Chryssa carried out a great variety of projects ranging from networking to software engineering. She is very keen on front end development especially on mobile technologies and web applications. She has worked as a junior Software Engineer in the telecommunications area and currently works as an Android Developer.","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/chryssa-aliferi\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39080","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\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=39080"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39080\/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=39080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=39080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=39080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}