Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Android.App;
- using Android.Content;
- using Android.Runtime;
- using Android.Views;
- using Android.Widget;
- using Android.OS;
- namespace AppTest1
- {
- [Activity (Label = "Pathfinder Combat Companion", MainLauncher = true, Icon = "@drawable/icon")]
- public class MainActivity : Activity
- {
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- SetContentView(Resource.Layout.Main);
- CreateTab(typeof(Combat_Statistics), "combat_stats", "Combat Statistics", Resource.Drawable.ic_tab_whats_on);
- CreateTab(typeof(ConditionsBuffs), "condi_buffs", "Consitions/Buffs", Resource.Drawable.ic_tab_speakers);
- CreateTab(typeof(Skills), "skills", "Skills", Resource.Drawable.ic_tab_sessions);
- CreateTab(typeof(Spellbook), "spellbook", "Spellbook", Resource.Drawable.ic_tab_my_schedule);
- }
- private void CreateTab(Type activityType, string tag, string label, int drawableId )
- {
- var intent = new Intent(this, activityType);
- intent.AddFlags(ActivityFlags.NewTask);
- var spec = TabHost.NewTabSpec(tag);
- var drawableIcon = Resources.GetDrawable(drawableId);
- spec.SetIndicator(label, drawableIcon);
- spec.SetContent(intent);
- TabHost.AddTab(spec);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement