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


C# Bundle.PutStringArray方法代码示例

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


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

示例1: OnCreateView

        public override View OnCreateView(LayoutInflater inflater,
        ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var view = inflater.Inflate(
                Resource.Layout.activity_category, container, false);

            GridView gridView = (GridView)view.FindViewById(Resource.Id.grid_view);
            // Instance of ImageAdapter Class

            var categories = DataHandler.LoadCategoriesFromLocalDatabase(new LocalDB());

            gridView.SetAdapter(new CategoryAdapter(view.Context, categories));

            gridView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {

                List<string> choiceList = new List<string>();
                List<string> detailList = new List<string>();

                var category = categories[args.Position];
                var choices = categories[args.Position].Choices;

                // Add each choice from selected category to list
                // Add each detail from selected choice to list
                foreach (var choice in choices)
                {
                    choiceList.Add(choice.Name);
 
                    detailList.AddRange(choice.Details.Select(detail => detail.Name));
                }

                if (choices == null || choices.Count == 0 || String.IsNullOrEmpty(choices[0].Name))
                // String.IsNullOrEmpty(choices[0].Name) = Dummy, hvis der er en tom Choice liste uden et navn
                {
                    CallEntity callEntity = CallWrapper.WrapCall(UserData.CPRNR, CallUtil.StatusCode.Active, category);
                    Call.MakeCall(callEntity, Activity);
                }
                else
                {
                    Bundle bundle = new Bundle();

                    bundle.PutStringArray("choices", choiceList.ToArray());
                    bundle.PutStringArray("details", detailList.ToArray());
                    bundle.PutString("category", categories[args.Position].Name);

                    Intent intent = new Intent(Application.Context, typeof(ChoiceActivity));
                    intent.PutExtras(bundle);

                    StartActivity(intent);
                }
            };
            return view;
        }
开发者ID:dsb92,项目名称:patientcare,代码行数:55,代码来源:CategoryFragment.cs

示例2: NewInstance

		/// <summary>
		/// Creates a new instance of ConfirmationDialogFragment.
		/// </summary>
		/// <returns>A new instance.</returns>
		/// <param name="resources">The list of resources requested by PermissionRequeste.</param>
		public static ConfirmationDialogFragment NewInstance (String[] resources)
		{
			var fragment = new ConfirmationDialogFragment ();
			var args = new Bundle ();
			args.PutStringArray (ARG_RESOURCES, resources);
			fragment.Arguments = args;
			return fragment;
		}
开发者ID:GTmAster,项目名称:monodroid-samples,代码行数:13,代码来源:ConfirmationDialogFragment.cs

示例3: OnListItemClick

        void OnListItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var choice = choiceList[e.Position];
            var intent = new Intent(Application.Context, typeof(DetailChoiceActivity));

            // Hvis der er ikke er nogen detailer, start kaldet her
            if (choice == null || details.Count == 0)
            {
                CallEntity callEntity = CallWrapper.WrapCall(UserData.CPRNR, CallUtil.StatusCode.Active, category, choice);
                AppDelegate.MakeCall(callEntity, choice.Name, vc);
            }


            Bundle bundle = new Bundle();
            bundle.PutStringArray("details", detailList.ToArray());
            bundle.PutString("choice", choice);
            intent.PutExtras(bundle);
            StartActivity(intent);
        }
开发者ID:dsb92,项目名称:patientcare,代码行数:19,代码来源:ChoiceActivity.cs

示例4: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            sInstance = this;

            base.OnCreate(bundle);

            Game1.Activity = this;
            mGame = new Game1();
            SetContentView(mGame.Window);

            using (var ignore = new TV.Ouya.Sdk.OuyaInputView(this))
            {
                // do nothing
            }

            View content = FindViewById (Android.Resource.Id.Content);
            if (null != content) {
                content.KeepScreenOn = true;
            }
            mGame.Run();

            Bundle developerInfo = new Bundle();

            developerInfo.PutString(OuyaFacade.OUYA_DEVELOPER_ID, "310a8f51-4d6e-4ae5-bda0-b93878e5f5d0");

            byte[] applicationKey = null;

            // load the application key from assets
            try {
                AssetManager assetManager = ApplicationContext.Assets;
                AssetFileDescriptor afd = assetManager.OpenFd(SIGNING_KEY);
                int size = 0;
                if (null != afd) {
                    size = (int)afd.Length;
                    afd.Close();
                    using (Stream inputStream = assetManager.Open(SIGNING_KEY, Access.Buffer))
                    {
                        applicationKey = new byte[size];
                        inputStream.Read(applicationKey, 0, size);
                        inputStream.Close();
                    }
                }
            } catch (Exception e) {
                Log.Error (TAG, string.Format("Failed to read application key exception={0}", e));
            }

            if (null != applicationKey) {
                Log.Debug (TAG, "Read signing key");
                developerInfo.PutByteArray (OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, applicationKey);
            } else {
                Log.Error (TAG, "Failed to authorize with signing key");
                Finish ();
                return;
            }

            developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_ID, "0000000000000");
            developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_KEY, "000000000000000000");

            developerInfo.PutStringArray(OuyaFacade.OUYA_PRODUCT_ID_LIST, Game1.PURCHASABLES);

            _ouyaFacade = OuyaFacade.Instance;
            _ouyaFacade.Init(this, developerInfo);
        }
开发者ID:wister01,项目名称:ouya-sdk-examples,代码行数:63,代码来源:Activity1.cs

示例5: ToBundle

 public void ToBundle(Bundle b)
 {
     b.PutStringArray(Key, Value);
 }
开发者ID:pythe,项目名称:wristpass,代码行数:4,代码来源:AppTask.cs

示例6: GetPlusClientFragment

      // Attach a PlusClient managing fragment to you activity.
      public static PlusClientFragment GetPlusClientFragment(
              FragmentActivity activity, String[] visibleActivities)
      {
         if (!(activity is OnSignedInListener))
         {
            throw new ArgumentException(
                    "The activity must implement OnSignedInListener to receive callbacks.");
         }

         // Check if the fragment is already attached.
         FragmentManager fragmentManager = activity.GetSupportFragmentManager();
         Fragment fragment = fragmentManager.FindFragmentByTag(TAG_PLUS_CLIENT);
         if (fragment is PlusClientFragment)
         {
            // The fragment is attached.  If it has the right visible activities, return it.
            if (Arrays.Equals(visibleActivities,
                    fragment.GetArguments().GetStringArray(ARG_VISIBLE_ACTIVITIES)))
            {
               return (PlusClientFragment)fragment;
            }
         }

         FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();
         // If a fragment was already attached, remove it to clean up.
         if (fragment != null)
         {
            fragmentTransaction.Remove(fragment);
         }

         // Create a new fragment and attach it to the fragment manager.
         Bundle arguments = new Bundle();
         arguments.PutStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
         PlusClientFragment signInFragment = new PlusClientFragment();
         signInFragment.SetArguments(arguments);
         fragmentTransaction.Add(signInFragment, TAG_PLUS_CLIENT);
         fragmentTransaction.Commit();
         return signInFragment;
      }
开发者ID:MahendrenGanesan,项目名称:samples,代码行数:39,代码来源:PlusClientFragment.cs

示例7: OnSaveInstanceState

		public override void OnSaveInstanceState (Bundle outState)
		{
			List<string> myList = mAdapter.getTrakkedShows ();

			if (myList.Count != 0) {

				string[] myArray = new string[myList.Count];
				for (int i = 0; i < myList.Count; i++) {
					myArray [i] = myList [i];

				}

				outState.PutStringArray ("TrakkedList", myArray);
			}

			Console.WriteLine ("##$$###$$### I Saved my bundle with size " + myList.Count);

		}
开发者ID:robobat,项目名称:Trakker,代码行数:18,代码来源:AddShowsFragment.cs


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