当前位置: 首页>>代码示例>>C#>>正文


C# Bundle.ContainsKey方法代码示例

本文整理汇总了C#中Bundle.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.ContainsKey方法的具体用法?C# Bundle.ContainsKey怎么用?C# Bundle.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bundle的用法示例。


在下文中一共展示了Bundle.ContainsKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            SetContentView (Resource.Layout.AssignmentsTabsLayout);

            tabHost = FindViewById<TabHost> (Resource.Id.assingmentTabHost);
            //In order to use tabs outside of a TabActivity I have to use this local activity manager and dispatch create the savedInstanceState
            localManger = new LocalActivityManager (this, true);
            localManger.DispatchCreate (savedInstanceState);
            tabHost.Setup (localManger);

            TabHost.TabSpec assignmentsSpec = tabHost.NewTabSpec ("list");
            Intent assignmentIntent = new Intent (this, typeof (AssignmentsActivity));
            assignmentsSpec.SetContent (assignmentIntent);
            assignmentsSpec.SetIndicator ("list");

            TabHost.TabSpec mapViewSpec = tabHost.NewTabSpec ("map");
            Intent mapViewIntent = new Intent (this, typeof (MapViewActivity));
            mapViewSpec.SetContent (mapViewIntent);
            mapViewSpec.SetIndicator ("map");

            tabHost.AddTab (assignmentsSpec);
            tabHost.AddTab (mapViewSpec);

            tabHost.TabChanged += (sender, e) => {
                if (tabHost.CurrentTab == 0) {
                    MapData = null;
                }
            };

            try {
                if (savedInstanceState != null) {
                    if (savedInstanceState.ContainsKey (Constants.CurrentTab)) {
                        var currentTab = savedInstanceState.GetInt (Constants.CurrentTab, 0);
                        tabHost.CurrentTab = currentTab;
                    } else {
                        tabHost.CurrentTab = 0;
                    }
                    if (savedInstanceState.ContainsKey ("mapData")) {
                        MapData = (MapDataWrapper)savedInstanceState.GetSerializable ("mapData");
                    } else {
                        MapData = null;
                    }
                } else {
                    MapData = null;
                    tabHost.CurrentTab = 0;
                }
            } catch (Exception) {
                tabHost.CurrentTab = 0;
            }            
        }
开发者ID:harouny,项目名称:prebuilt-apps,代码行数:52,代码来源:AssignmentTabActivity.cs

示例2: OnCreate

 protected override void OnCreate(Bundle bundle)
 {
     RequestWindowFeature(WindowFeatures.NoTitle);
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.Viewer);
     // associate the views
     MainImage = FindViewById<ZoomImageView>(Resource.Id.MainImage);
     Zoom = FindViewById<ZoomControls>(Resource.Id.ZoomButtons);
     OpenButton = FindViewById<ImageButton>(Resource.Id.OpenButton);
     LeftButton = FindViewById<ImageButton>(Resource.Id.LeftButton);
     RightButton = FindViewById<ImageButton>(Resource.Id.RightButton);
     // wire the views
     Zoom.ZoomInClick += (src, args) => MainImage.ZoomIn();
     Zoom.ZoomOutClick += (src, args) => MainImage.ZoomOut();
     OpenButton.Click += (src, args) => OnOpenButtonClick(args);
     LeftButton.Click += (src, args) => OnLeftButtonClick(args);
     RightButton.Click += (src, args) => OnRightButtonClick(args);
     // get preferences
     var prefs = GetSharedPreferences("Global", FileCreationMode.Private);
     // check bundles and prefs
     if (Intent.Extras != null && Intent.Extras.ContainsKey("ComicsPath"))
         Controller = new ViewerController(this, Intent.Extras.GetString("ComicsPath"));
     else if (bundle != null && bundle.ContainsKey("ComicsPath"))
         Controller = new ViewerController(this, bundle.GetString("ComicsPath"));
     else
         Controller = new ViewerController(this, prefs.GetString("ComicsPath", null));
 }
开发者ID:vosen,项目名称:UAM.MobileLabs,代码行数:27,代码来源:ViewerActivity.cs

示例3: OnCreate

		public override void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);

			if ((savedInstanceState != null) && savedInstanceState.ContainsKey(KeyContent))
				_content = savedInstanceState.GetString(KeyContent);
		}
开发者ID:ashokkumarreddy1987,项目名称:learnings,代码行数:7,代码来源:TestFragment.cs

示例4: OnCreate

        protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
            currentBaseUrl = "file://android_asset/";
            currentUrl = "file:///android_asset/index.html";

            if (bundle != null)
            {
                if (bundle.ContainsKey(UrlKey))
                    currentUrl = bundle.GetString(UrlKey);
                if (bundle.ContainsKey(ConfigKey))
                    inputConfiguration = JsonSerializer.Deserialize<InputConfiguration>(bundle.GetString(ConfigKey));
            }

            CheckFirstRun();
            LoadUrl();
		}
开发者ID:samiy-xx,项目名称:KeySndr.Clients,代码行数:17,代码来源:MainActivity.cs

示例5: OnCreate

        //@Override
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if ((savedInstanceState != null) && savedInstanceState.ContainsKey(KEY_CONTENT))
            {
                mContent = savedInstanceState.GetString(KEY_CONTENT);
            }
        }
开发者ID:skywolf888,项目名称:ViewPagerIndicator.Net,代码行数:10,代码来源:TestFragment.cs

示例6: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Main);

            // extract authInProgress from bundle if it's in there
            if (bundle != null && bundle.ContainsKey ("authInProgress")) {
                authInProgress = bundle.GetBoolean ("authInProgress");
            }

            BuildApiClient ();
        }
开发者ID:sl-android,项目名称:android-fit-xamarin,代码行数:12,代码来源:MainActivity.cs

示例7: UpdateCanSayHello

        void UpdateCanSayHello(RestrictionEntry entry, Bundle restrictions)
        {
            bool canSayHello;
            if (restrictions == null || !restrictions.ContainsKey (KEY_CAN_SAY_HELLO))
                canSayHello = entry.SelectedState;
            else
                canSayHello = restrictions.GetBoolean (KEY_CAN_SAY_HELLO);

            textSayHello.SetText (canSayHello ? Resource.String.explanation_can_say_hello_true :
                Resource.String.explanation_can_say_hello_false);
            buttonSayHello.Enabled = canSayHello;
        }
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:12,代码来源:AppRestrictionSchemaFragment.cs

示例8: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Console.WriteLine("OnCreateView from Fragment");

            // Why?
            base.OnCreateView(inflater, container, savedInstanceState);

            // Title saved?
            if ((savedInstanceState != null) && savedInstanceState.ContainsKey(KeyContent))
            {
                Title = savedInstanceState.GetString(KeyContent);
            }

            // Content
            return this.BindingInflate(_resourceId, null);
        }
开发者ID:hugoterelle,项目名称:TestFragment,代码行数:16,代码来源:MvxFragmentWithTitle.cs

示例9: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			if ((savedInstanceState != null) && savedInstanceState.ContainsKey (KEY_CONTENT)) {
				mContent = savedInstanceState.GetString (KEY_CONTENT);
			}
	
			TextView text = new TextView (Activity);
			text.Gravity = GravityFlags.Center;
			text.Text = mContent;
			text.TextSize = (20 * Resources.DisplayMetrics.Density);
			text.SetPadding (20, 20, 20, 20);
	
			LinearLayout layout = new LinearLayout (Activity);
			layout.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
			layout.SetGravity (GravityFlags.Center);
			layout.AddView (text);
	
			return layout;
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:19,代码来源:TestFragment.cs

示例10: OnCreate

		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.main_activity);

			mRequestActivityUpdatesButton = FindViewById<Button> (Resource.Id.request_activity_updates_button);
			mRemoveActivityUpdatesButton = FindViewById<Button> (Resource.Id.remove_activity_updates_button);
			mDetectedActivitiesListView = FindViewById<ListView> (Resource.Id.detected_activities_listview);

			mRequestActivityUpdatesButton.Click += RequestActivityUpdatesButtonHandler;
			mRemoveActivityUpdatesButton.Click += RemoveActivityUpdatesButtonHandler;

			mBroadcastReceiver = new ActivityDetectionBroadcastReceiver ();
			mBroadcastReceiver.OnReceiveImpl = (context, intent) => {
				var updatedActivities = intent.GetParcelableArrayExtra (Constants.ActivityExtra).Cast<DetectedActivity>().ToList();
				UpdateDetectedActivitiesList (updatedActivities);
			};

			SetButtonsEnabledState ();

			if (savedInstanceState != null && savedInstanceState.ContainsKey (
				    Constants.DetectedActivities)) {
				mDetectedActivities = JsonConvert.DeserializeObject<List<DetectedActivity>>(savedInstanceState.GetString (Constants.DetectedActivities));
			} else {
				mDetectedActivities = new List<DetectedActivity> ();

				for (int i = 0; i < Constants.MonitoredActivities.Length; i++) {
					mDetectedActivities.Add (new DetectedActivity (Constants.MonitoredActivities [i], 0));
				}
			}

			mAdapter = new DetectedActivitiesAdapter (this, mDetectedActivities);
			mDetectedActivitiesListView.Adapter = mAdapter;

			buildGoogleApiClient ();
		}
开发者ID:namratasingh123,项目名称:monodroid-samples,代码行数:36,代码来源:MainActivity.cs

示例11: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            if (bundle != null && bundle.ContainsKey(ImagePathKey))
            {
                _imagePath = bundle.GetString(ImagePathKey);
            }

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var captureImageButton = FindViewById<ImageButton>(Resource.Id.image_button);
            captureImageButton.Click += (x, y) =>
                {
                    CaptureImage();
                };

            DateButton.Text = DateTime.Today.ToShortDateString();
            DateButton.Click += (x, y) =>
                {
                    var today = DateTime.Today.Date;
                    // Create a new instance of DatePickerDialog and return it
                    var dialog = new DatePickerDialog(this, OnDatePicked, today.Year, today.Month, today.Day);
                    dialog.Show();
                };

            var submitButton = FindViewById<Button>(Resource.Id.submit_button);
            submitButton.Click += (x, y) =>
            {
                var progress = ProgressDialog.Show(this, "Processing", "Please Wait...", false);
                Task.Factory.StartNew(
                    () =>
                    {
                        var answers = new CustomerComponent().Submit(GetCaptureEntity());
                        return answers;
                    })
                    .ContinueWith(result => OnCompleteAsnycSubmit(result, progress));
                progress.Show();
            };
        }
开发者ID:dancarlstedt,项目名称:Mono-ChallengeApp,代码行数:41,代码来源:HomeScreen.cs

示例12: OnViewStateRestored

		public override void OnViewStateRestored (Bundle savedInstanceState)
		{
			base.OnViewStateRestored (savedInstanceState);
			if (savedInstanceState != null && savedInstanceState.ContainsKey ("previousPosition")) {
				var pos = savedInstanceState.GetParcelable ("previousPosition") as CameraPosition;
				if (pos != null) {
					var update = CameraUpdateFactory.NewCameraPosition (pos);
					mapFragment.Map.MoveCamera (update);
				}
			}
		}
开发者ID:adamgoodrich,项目名称:Moyeu,代码行数:11,代码来源:HubwayMapFragment.cs

示例13: ValidOwnedItems

 static bool ValidOwnedItems(Bundle purchased)
 {
     return	purchased.ContainsKey (Response.InAppPurchaseItemList)
         && purchased.ContainsKey (Response.InAppPurchaseDataList)
         && purchased.ContainsKey (Response.InAppDataSignatureList);
 }
开发者ID:camradal,项目名称:TodayILearned,代码行数:6,代码来源:InAppBillingHelper.cs

示例14: OnRestoreInstanceState

 protected override void OnRestoreInstanceState(Bundle savedInstanceState)
 {
     if (savedInstanceState.ContainsKey("selected"))
     {
         ActionBar.SetSelectedNavigationItem(savedInstanceState.GetInt("selected"));
     }
 }
开发者ID:camradal,项目名称:TodayILearned,代码行数:7,代码来源:HomeActivity.cs

示例15: OnActivityCreated

 public override void OnActivityCreated(Bundle savedInstanceState)
 {
     base.OnActivityCreated(savedInstanceState);
     if (savedInstanceState != null)
     {
         if (savedInstanceState.ContainsKey(MONITOR_KEY))
             startMonitor = savedInstanceState.GetBoolean(MONITOR_KEY);
         if (savedInstanceState.ContainsKey(VOICE_KEY))
             switchVoice.Checked = savedInstanceState.GetBoolean(VOICE_KEY);
     }
 }
开发者ID:shaxxx,项目名称:SignalMeter,代码行数:11,代码来源:SignalFragment.cs


注:本文中的Bundle.ContainsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。