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


C# Bundle.GetParcelable方法代码示例

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


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

示例1: OnCreate

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

            SetContentView (Resource.Layout.split_street_view_panorama_and_map_demo);

            if (savedInstanceState == null)
                markerPosition = SYDNEY;
            else
                markerPosition = savedInstanceState.GetParcelable (MARKER_POSITION_KEY).JavaCast<LatLng> ();
            
            var streetViewPanoramaFragment =
                (SupportStreetViewPanoramaFragment)
                SupportFragmentManager.FindFragmentById (Resource.Id.streetviewpanorama);
            
            streetViewPanoramaFragment.GetStreetViewPanoramaAsync (this);

            SupportMapFragment mapFragment =
                (SupportMapFragment) SupportFragmentManager.FindFragmentById (Resource.Id.map);
            mapFragment.GetMapAsync (this);
//                @Override
//                public void onMapReady(GoogleMap map) {
//                    map.setOnMarkerDragListener(SplitStreetViewPanoramaAndMapDemoActivity.this);
//                    // Creates a draggable marker. Long press to drag.
//                    mMarker = map.addMarker(new MarkerOptions()
//                        .position(markerPosition)
//                        .icon(BitmapDescriptorFactory.fromResource(R.drawable.pegman))
//                        .draggable(true));
//                }
//            });
        }
开发者ID:FirstClickStart,项目名称:yesterdaysMuffins,代码行数:31,代码来源:SplitStreetViewPanoramaAndMapDemoActivity.cs

示例2: OnCreate

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

			if (savedInstanceState != null) {
				resultCode = savedInstanceState.GetInt (STATE_RESULT_CODE);
				resultData = (Intent)savedInstanceState.GetParcelable (STATE_RESULT_DATA);
			}
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:9,代码来源:ScreenCaptureFragment.cs

示例3: OnRestoreInstanceState

		protected override void OnRestoreInstanceState (Bundle savedInstanceState) 
		{
			base.OnRestoreInstanceState (savedInstanceState);
        
			mGesture = (Gesture) savedInstanceState.GetParcelable ("gesture");
			if (mGesture != null) {
				var overlay = (GestureOverlayView) FindViewById (Resource.Id.gestures_overlay);
				overlay.Post (() => overlay.Gesture = mGesture);

				mDoneButton.Enabled = true;
			}
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:12,代码来源:CreateGestureActivity.cs

示例4: MyButton_OnClick

        public void MyButton_OnClick(View view)
        {
            ((Button)view).Text = "clicked!";

            Bundle b = new Bundle ();
            var p = Parcel.Obtain ();
            b.PutSerializable ("dummy", new MySerializable ());
            b.PutParcelable ("dummy2", new MyParcelable ());
            p.WriteBundle (b);
            p.SetDataPosition (0);
            var b2 = p.ReadBundle ();
            Console.WriteLine (b2);
            var p2 = b.GetParcelable ("dummy2");
            Console.WriteLine (p2);
        }
开发者ID:JesseChang,项目名称:monodroid-samples,代码行数:15,代码来源:MainActivity.cs

示例5: FragmentArgumentsToIntent

        /// <summary>
        /// Fragments the arguments to intent.
        /// </summary>
        /// <returns>The arguments to intent.</returns>
        /// <param name="arguments">Arguments.</param>
        public static Intent FragmentArgumentsToIntent(Bundle arguments)
        {
            Intent intent = new Intent();
            if (arguments == null)
            {
                return intent;
            }

            var data = arguments.GetParcelable("_uri") as Uri;
            if (data != null)
            {
                intent.SetData(data);
            }

            intent.PutExtras(arguments);
            intent.RemoveExtra("_uri");
            return intent;
        }
开发者ID:prashantvc,项目名称:XamarinIO,代码行数:23,代码来源:BaseActivity.cs

示例6: UpdateValuesFromBundle

		void UpdateValuesFromBundle (Bundle savedInstanceState)
		{
			if (savedInstanceState != null) {
				if (savedInstanceState.KeySet ().Contains (KEY_REQUESTING_LOCATION_UPDATES)) {
					mRequestingLocationUpdates = savedInstanceState.GetBoolean (
						KEY_REQUESTING_LOCATION_UPDATES);
				}

				if (savedInstanceState.KeySet ().Contains (KEY_LOCATION)) {
					mCurrentLocation = (Location)savedInstanceState.GetParcelable (KEY_LOCATION);
				}

				if (savedInstanceState.KeySet ().Contains (KEY_LAST_UPDATED_TIME_STRING)) {
					mLastUpdateTime = savedInstanceState.GetString (KEY_LAST_UPDATED_TIME_STRING);
				}
				UpdateUI ();
			}
		}
开发者ID:jingyul,项目名称:monodroid-samples,代码行数:18,代码来源:MainActivity.cs

示例7: UpdateValuesFromBundle

		void UpdateValuesFromBundle (Bundle savedInstanceState)
		{
			Log.Info (TAG, "Updating values from bundle");
			if (savedInstanceState != null) {
				if (savedInstanceState.KeySet ().Contains (REQUESTING_LOCATION_UPDATES_KEY)) {
					mRequestingLocationUpdates = savedInstanceState.GetBoolean (REQUESTING_LOCATION_UPDATES_KEY);
					SetButtonsEnabledState();
				}

				if (savedInstanceState.KeySet ().Contains (LOCATION_KEY)) {
					mCurrentLocation = (Location)savedInstanceState.GetParcelable (LOCATION_KEY);
				}

				if (savedInstanceState.KeySet ().Contains (LAST_UPDATED_TIME_STRING_KEY)) {
					mLastUpdateTime = savedInstanceState.GetString (LAST_UPDATED_TIME_STRING_KEY);
				}
				UpdateUI ();
			}
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:19,代码来源:MainActivity.cs

示例8: MyButton_OnClick

        public void MyButton_OnClick(View view)
        {
            ((Button)view).Text = "clicked!";

            Console.WriteLine ("Activity1.MyButton_OnClick: Writing into Bundle...");

            Bundle b = new Bundle ();
            var p = Parcel.Obtain ();
            b.PutSerializable ("dummy", new MySerializable ("foo"));
            b.PutParcelable ("dummy2", new MyParcelable ("bar"));
            p.WriteBundle (b);
            p.SetDataPosition (0);

            Console.WriteLine ("Activity1.MyButton_OnClick: Reading from Parcel...");
            var b2 = p.ReadBundle ();
            Console.WriteLine ("Read Bundle: {0}", b2);
            var s  = b.GetSerializable ("dummy");
            Console.WriteLine ("Read Serializable: {0}", s);
            var p2 = b.GetParcelable ("dummy2");
            Console.WriteLine ("Read Parcelable: {0}", p2);
        }
开发者ID:vkheleli,项目名称:monodroid-samples-master,代码行数:21,代码来源:MainActivity.cs

示例9: OnCreate

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

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

			photoImageView = FindViewById<ImageView> (Resource.Id.photoImageView);
			locationText = FindViewById<TextView> (Resource.Id.locationText);
			facebookButton = FindViewById<Button> (Resource.Id.facebookButton);
			flickrButton = FindViewById<Button> (Resource.Id.flickrButton);
			twitterButton = FindViewById<Button> (Resource.Id.twitterButton);
			appnetButton = FindViewById<Button> (Resource.Id.appnetButton);

			facebookButton.Click += ShareFacebook_Click;
			flickrButton.Click += ShareFlickr_Click;
			twitterButton.Click += ShareTwitter_Click;
			appnetButton.Click += ShareAppnet_Click;

			//if reuse Bitmap if present
			fileName = savedInstanceState == null ? string.Empty : savedInstanceState.GetString (FileNameKey, string.Empty);
			bitmap = savedInstanceState == null ? null : (Bitmap) savedInstanceState.GetParcelable ("image");
		}
开发者ID:mansourb7,项目名称:mobile-samples,代码行数:23,代码来源:PhotoScreen.cs

示例10: 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

示例11: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (Arguments != null)
            {
                site = Arguments.GetString("baseUrl", "http://smartreporter.altervista.org/");
            }

            searching = false;
            loadedSite = "http://smartreporter.altervista.org/";

            var rootView = inflater.Inflate(Resource.Layout.list_fragment, container, false);

            if (savedInstanceState != null)
            {
                IParcelable savedRecyclerLayoutState = (IParcelable)savedInstanceState.GetParcelable("recycler_layout");
                listViewNews.GetLayoutManager().OnRestoreInstanceState(savedRecyclerLayoutState);
            }

            pbNews = rootView.FindViewById<RelativeLayout>(Resource.Id.pbNews);
            listViewNews = rootView.FindViewById<RecyclerView>(Resource.Id.list_news);
            emptyView = rootView.FindViewById<TextView>(Resource.Id.empty_view);

            //Setup layout manager
            PreCachingLayoutManager mLayoutManager = new PreCachingLayoutManager(Application.Context);
            mLayoutManager.Orientation = LinearLayoutManager.Vertical;
            mLayoutManager.SetExtraLayoutSpace(GetScreenHeight(Activity));
            listViewNews.SetLayoutManager(mLayoutManager);

            listViewNews.AddOnScrollListener(new mOnScrollListener(this));

            refresher = rootView.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorSchemeResources(Resource.Color.orange, Resource.Color.green, Resource.Color.blue);

            refresher.Refresh += (sender, e) =>
            {
                pbNews.Visibility = ViewStates.Visible;
                load(site + "feed", true);
                page = 1;
                detecting = true;
            };

            load(site + "feed", false);

            return rootView;
        }
开发者ID:YoDevil,项目名称:SmartReport,代码行数:45,代码来源:ListFragment.cs


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