[{"data":1,"prerenderedAt":268},["ShallowReactive",2],{"article-xamarin-please-install-package-android-support-library":3},{"article":4,"tags":113,"previous":128,"next":190},{"id":5,"title":6,"author":7,"body":8,"createdAt":102,"description":103,"extension":104,"img":77,"meta":105,"navigation":106,"path":107,"seo":108,"stem":109,"tags":110,"updatedAt":102,"__hash__":112},"articles\u002Farticles\u002Fxamarin-please-install-package-android-support-library.md","Xamarin Please install package ‘Android Support Library’","[object Object]",{"type":9,"value":10,"toc":100},"minimark",[11,15,56,80,88,96],[12,13,14],"p",{},"  My Xamarin Android project would not build.  The build output had the following exception\u002Ferror.\nSeverity Code Description Project File Line Suppression State Error",[16,17,22],"pre",{"className":18,"code":19,"language":20,"meta":21,"style":21},"language-html shiki shiki-themes github-light github-dark","Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. \nAndroid resource directory C:\\Users\\{username}\\AppData\\Local\\Xamarin\\Android.Support.v4\\22.2.0\\embedded\\.\u002F doesn't exist.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \nC:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.Android.Common.targets 349&nbsp;&nbsp;&nbsp;  \n","html","",[23,24,25,34,47],"code",{"__ignoreMap":21},[26,27,30],"span",{"class":28,"line":29},"line",1,[26,31,33],{"class":32},"sVt8B","Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. \n",[26,35,37,40,44],{"class":28,"line":36},2,[26,38,39],{"class":32},"Android resource directory C:\\Users\\{username}\\AppData\\Local\\Xamarin\\Android.Support.v4\\22.2.0\\embedded\\.\u002F doesn't exist.",[26,41,43],{"class":42},"sj4cs","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",[26,45,46],{"class":32}," \n",[26,48,50,53],{"class":28,"line":49},3,[26,51,52],{"class":32},"C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.Android.Common.targets 349",[26,54,55],{"class":42},"&nbsp;&nbsp;&nbsp;\n",[12,57,58,59,66,67],{},"I started to get this error after adding the component Android Support Library v7 AppCompat (version 22.2.0.0) This component has dependencies on Xamarin.Android.Support.v4.\nAfter much time and looking at Android SDK’s ",[60,61,62],"strong",{},[63,64,65],"u",{},"the resolution"," was to remove the respective zip file from this directory\nC:\\Users{username}\\AppData\\Local\\Xamarin\\zips. Once I did this, a fresh build would re-download this package and unzip appropriate references\nto C:\\Users{username}\\AppData\\Local\\Xamarin.  In addition you can delete everything in the C:\\Users{username}\\AppData\\Local\\Xamarin\\Android.Support.v4 directory.\n",[68,69,71],"a",{"href":70},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_6.png",[72,73],"img",{"title":74,"style":75,"border":76,"alt":74,"src":77,"width":78,"height":79},"image","border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px",0,"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_thumb_2.png",294,88,[68,81,83],{"href":82},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_4.png",[72,84],{"title":74,"style":75,"border":76,"alt":74,"src":85,"width":86,"height":87},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_thumb_1.png",411,50,[68,89,91],{"href":90},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_2.png",[72,92],{"title":74,"style":75,"border":76,"alt":74,"src":93,"width":94,"height":95},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-245aeb9a3723_fde8-image_thumb.png",417,233,[97,98,99],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":21,"searchDepth":36,"depth":36,"links":101},[],"2016-02-06T12:29:47.8100000-05:00",null,"md",{},true,"\u002Farticles\u002Fxamarin-please-install-package-android-support-library",{"title":6,"description":103},"articles\u002Fxamarin-please-install-package-android-support-library",[111],"xamarin","8pRh1b0XfQH5mWwb5lohfycB3F0kfUGsZ2iKu_RUjUQ",[114],{"id":115,"title":116,"body":117,"description":121,"extension":104,"img":122,"meta":123,"name":111,"navigation":106,"path":124,"seo":125,"stem":126,"__hash__":127},"tags\u002Ftags\u002Fxamarin.md","Xamarin",{"type":9,"value":118,"toc":119},[],{"title":21,"searchDepth":36,"depth":36,"links":120},[],"Xamarin is an open-source platform for building modern and performant applications for iOS, Android, and Windows with . NET. Xamarin is an abstraction layer that manages communication of shared code with underlying platform code.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fxamarin",{"description":121},"tags\u002Fxamarin","deVB66I7cJMtWvqybFh5POf9LBCBwHNe-5ZGMOzV5G4",{"id":129,"title":130,"author":7,"body":131,"createdAt":182,"description":103,"extension":104,"img":183,"meta":184,"navigation":106,"path":185,"seo":186,"stem":187,"tags":188,"updatedAt":182,"__hash__":189},"articles\u002Farticles\u002Fxamarin-no-intellisense-in-axml-files.md","Xamarin No Intellisense in Xaml files",{"type":9,"value":132,"toc":180},[133,139,152,175],[12,134,135,138],{},[60,136,137],{},"Issue: ","Opening up AXML file and no intellisense in Visual Studio",[140,141,142,146,149],"ul",{},[143,144,145],"li",{},"open file explorer, navigate to c:\\program files (x86)\\MSBuild\\Xamarin",[143,147,148],{},"copy android-layout-xml.xsd and schemas.android.com.apk.res.android.xsd to C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Xml\\Schemas",[143,150,151],{},"XML – Schemas and Add selecting the 2 xsd files",[153,154,155,156,155,166,155],"blockquote",{},"  \n",[68,157,159],{"href":158},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_bee7-image_thumb-3-_2.png",[72,160],{"style":161,"src":162,"border":76,"alt":163,"title":163,"width":164,"height":165},"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;","\u002Farticles\u002Fimages\u002Fimages\u002Fwindows-live-writer-xamarin_bee7-image_thumb-3-_thumb.png","image_thumb[3]",240,111,[68,167,169],{"href":168},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_bee7-image_thumb-6-_2.png",[72,170],{"style":161,"src":171,"border":76,"alt":172,"title":172,"width":173,"height":174},"\u002Farticles\u002Fimages\u002Fimages\u002Fwindows-live-writer-xamarin_bee7-image_thumb-6-_thumb.png","image_thumb[6]",414,112,[140,176,177],{},[143,178,179],{},"Restart Visual Studio and your intellisense should be working now.",{"title":21,"searchDepth":36,"depth":36,"links":181},[],"2016-02-07T06:35:18.3500000-05:00","\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_bee7-image_thumb-3-_thumb.png",{},"\u002Farticles\u002Fxamarin-no-intellisense-in-axml-files",{"title":130,"description":103},"articles\u002Fxamarin-no-intellisense-in-axml-files",[111],"d2O3r4wtEPfVXQIoN_pal9vSxXjlFioRYQ0UIQJX7IQ",{"id":191,"title":192,"author":7,"body":193,"createdAt":260,"description":261,"extension":104,"img":207,"meta":262,"navigation":106,"path":263,"seo":264,"stem":265,"tags":266,"updatedAt":260,"__hash__":267},"articles\u002Farticles\u002Fxamarin-android-actionbar.md","Xamarin Android ActionBar",{"type":9,"value":194,"toc":258},[195,212,218,221,225,228,232],[12,196,197,198,201,209,211],{},"Ok so in prior posts I talked about adding drawer layout to my android project.  Today, I am going to add an actionbar to the project.  Starting with the end result of my first attempt see below.  I have an activity with tabs on each view.",[199,200],"br",{},[68,202,204],{"href":203},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_a3b5-image_2.png",[72,205],{"style":206,"src":207,"border":76,"alt":74,"title":74,"width":208,"height":164},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;","\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_a3b5-image_thumb.png",151,[199,210],{},"\nThis is how that was accomplished.  Within the OnCreate(Bundle bundle) method of the Activity",[16,213,217],{"className":214},[215,216],"brush:","csharp;","this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;              \nAddTab(\"Tab 1\", Resource.Drawable.ic_tab_white, new SampleTabFragment());  \nAddTab(\"Tab 2\", Resource.Drawable.ic_tab_white, new SampleTabFragment2());  \n  \nif (bundle != null)     this.ActionBar.SelectTab(this.ActionBar.GetTabAt(bundle.GetInt(\"tab\")));",[12,219,220],{},"Adding method AddTab",[16,222,224],{"className":223},[215,216],"        void AddTab(string tabText, int iconResourceId, Fragment view)  \n        {  \n            var tab = this.ActionBar.NewTab();  \n            tab.SetText(tabText);  \n            tab.SetIcon(Resource.Drawable.ic_tab_white);  \n  \n            \u002F\u002F must set event handler before adding tab  \n  \n            tab.TabSelected += delegate (object sender, Android.App.ActionBar.TabEventArgs e)  \n            {  \n                var fragment = this.FragmentManager.FindFragmentById(Resource.Id.frameLayout);  \n                if (fragment != null)  \n                    e.FragmentTransaction.Remove(fragment);  \n                e.FragmentTransaction.Add(Resource.Id.frameLayout, view);  \n            };  \n            tab.TabUnselected += delegate (object sender, Android.App.ActionBar.TabEventArgs e) {  \n                e.FragmentTransaction.Remove(view);  \n            };  \n  \n            this.ActionBar.AddTab(tab);  \n        }",[12,226,227],{},"Adding fragment classes for the end target for selecting a tab",[16,229,231],{"className":230},[215,216],"    public class SampleTabFragment : Fragment  \n    {  \n        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)  \n        {  \n            base.OnCreateView(inflater, container, savedInstanceState);  \n  \n            var view = inflater.Inflate(Resource.Layout.Tab, container, false);  \n            var sampleTextView = view.FindViewById\u003CTextView>(Resource.Id.sampleTextView);  \n            sampleTextView.Text = \"sample fragment text\";  \n  \n            return view;  \n        }  \n    }  \n  \n    public class SampleTabFragment2 : Fragment  \n    {  \n        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)  \n        {  \n            base.OnCreateView(inflater, container, savedInstanceState);  \n  \n            var view = inflater.Inflate(Resource.Layout.Tab, container, false);  \n            var sampleTextView = view.FindViewById\u003CTextView>(Resource.Id.sampleTextView);  \n            sampleTextView.Text = \"sample fragment text 2\";  \n  \n            return view;  \n        }  \n    }",[12,233,234,235,237,238,241,243,244,246,247,249],{},"When a user selects a tab, we have them hooked up to show the respective fragment.  I also noticed that the code within the TabSelected event could be replaced by the following FragmentManager code",[199,236],{},"\ntab.TabSelected += delegate (object sender, Android.App.ActionBar.TabEventArgs e) { \u002F\u002Fvar fragment = this.FragmentManager.FindFragmentById(Resource.Id.frameLayout); \u002F\u002Fif (fragment != null) \u002F\u002Fe.FragmentTransaction.Remove(fragment); \u002F\u002Fe.FragmentTransaction.Add(Resource.Id.frameLayout, view);    ",[60,239,240],{}," base.FragmentManager.BeginTransaction().Replace(Resource.Id.frameLayout, view).Commit(",[199,242],{},"\n};",[199,245],{},"\nWhile the above works to show tabs in my sample application this is not really what I am looking for. The following guide shows the different aspects of the ActionBar.  In our above example we were working with Tab Navigation.  Ideally, what I am looking for is how to get my tabs where the action buttons are shown.",[199,248],{},[68,250,252],{"href":251},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_a3b5-image_4.png",[72,253],{"style":254,"src":255,"border":76,"alt":74,"title":74,"width":256,"height":257},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;","\u002Farticles\u002Fimages\u002Fwindows-live-writer-xamarin_a3b5-image_thumb_1.png",290,279,{"title":21,"searchDepth":36,"depth":36,"links":259},[],"2016-02-06T08:02:02.1700000-05:00","More fun with actionbars with Xamarin",{},"\u002Farticles\u002Fxamarin-android-actionbar",{"title":192,"description":261},"articles\u002Fxamarin-android-actionbar",[111],"D9kSu3OBx2kAPQJfH-P1Y6pJDljKlYK_lEnLxL0fRJM",1781574771127]