/// <summary> /// Intents to fragment argument. /// </summary> /// <returns>The to fragment argument.</returns> /// <param name="intent">Intent.</param> public static Bundle IntentToFragmentArgument(Intent intent) { Bundle arguments = new Bundle(); if (intent == null) { return(arguments); } var data = intent.Data; if (data != null) { arguments.PutParcelable("_uri", data); } var extras = intent.Extras; if (extras != null) { arguments.PutAll(intent.Extras); } return(arguments); }
private void SaveViewFieldsValues(Bundle outState) { outState.PutAll(outState); outState.PutString(keyAdvertisementTitleText, advertisementTitle.Text); outState.PutString(keyAdvertisementDescriptionText, advertisementDescription.Text); outState.PutBoolean(keyRdBtnOnlyForSellValue, rdBtnOnlyForSell.Checked); outState.PutString(keyAdvertisementPriceValue, advertisementPrice.Text); outState.PutString(keyPhotoView1Path, mPhotoPath); outState.PutBoolean(keyPhotoIsTakingValue, photoIsTaking); }
protected override void OnSaveInstanceState(Bundle outState) { base.OnSaveInstanceState(outState); outState.PutAll(State); if (_selectedIoc != null) { outState.PutString(BundleKeySelectedIoc, IOConnectionInfo.SerializeToString(_selectedIoc)); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //we initialise the app key for our data store //var a = Android.Content.Res.AssetManager.GetObject(); ApiAssets = new Dictionary <string, string>(); //we read the api key file var inputStream = Assets.Open(Constants.API_KEYFILE); var jsonObject = System.Json.JsonValue.Load(inputStream); ApiAssets[Constants.ASSET_NAME_APPNAME] = jsonObject.decryptAndGetApiSetting(Constants.ASSET_NAME_APPNAME); ApiAssets[Constants.ASSET_PROJECT_ID] = jsonObject.decryptAndGetApiSetting(Constants.ASSET_PROJECT_ID); ApiAssets[Constants.ASSET_NAME_SVC_ACCTEMAIL] = jsonObject.decryptAndGetApiSetting(Constants.ASSET_NAME_SVC_ACCTEMAIL); ApiAssets[Constants.ASSET_DATASTORE_APPKEY] = jsonObject.decryptAndGetApiSetting(Constants.ASSET_DATASTORE_APPKEY); ApiAssets[Constants.ASSET_P12KEYFILE] = jsonObject.decryptAndGetApiSetting(Constants.ASSET_P12KEYFILE); ProjectId = ApiAssets[Constants.ASSET_PROJECT_ID]; //ASSET_DATASTORE_APPKEY DataStoreApplicationKey = ApiAssets[Constants.ASSET_DATASTORE_APPKEY]; if (BigBundle == null) { BigBundle = new Bundle(); } if (bundle != null && bundle.ContainsKey(ALL_VALUES)) { BigBundle.PutAll(bundle.GetBundle(ALL_VALUES)); var resultsView = FindViewById <TextView>(Resource.Id.textAllValues); resultsView.Text = BigBundle.ToString(); } // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button>(Resource.Id.SaveData); button.Click += buttonClicked; var button2 = FindViewById <Button>(Resource.Id.fetchData); button2.Click += getWebResource; //var showLoginButton = FindViewById<Button>(Resource.Id.showLoginForm); //showLoginButton.Click += LoginButton_Click; //var loginFormButton = FindViewById<Button>(Resource.Id.buttonLoginIn); //loginFormButton.Click += doLoginIn_Click; }
// Don't add additional accounts //throws NetworkErrorException public override Bundle AddAccount(AccountAuthenticatorResponse response, string accountType, string authTokenType, string[] requiredFeatures, Bundle options) { var intent = new Intent(mContext, typeof(LoginActivity)); intent.PutExtra(LoginActivity.EXTRA_TOKEN_TYPE, accountType); intent.PutExtra(AccountManager.KeyAccountAuthenticatorResponse, response); var bundle = new Bundle(); if (options != null) { bundle.PutAll(options); } bundle.PutParcelable(AccountManager.KeyIntent, intent); return bundle; }
public void SaveState(Bundle outBundle) { if (_mStateMap.MSavedState != null) { outBundle.PutAll(_mStateMap.MSavedState); } var map = _mStateMap.Map; foreach (var item in map) { item.Value.SaveTo(outBundle, item.Key); } }
/// <summary> /// Intents to fragment argument. /// </summary> /// <returns>The to fragment argument.</returns> /// <param name="intent">Intent.</param> public static Bundle IntentToFragmentArgument(Intent intent) { Bundle arguments = new Bundle(); if (intent == null) { return arguments; } var data = intent.Data; if (data != null) { arguments.PutParcelable("_uri", data); } var extras = intent.Extras; if (extras != null) { arguments.PutAll(intent.Extras); } return arguments; }
protected override void OnSaveInstanceState(Bundle outState) { base.OnSaveInstanceState(outState); outState.PutAll(State); }
protected override void OnSaveInstanceState(Bundle outState) { base.OnSaveInstanceState(outState); outState.PutAll(State); if (_selectedIoc != null) outState.PutString(BundleKeySelectedIoc, IOConnectionInfo.SerializeToString(_selectedIoc)); }
public static void putAll(this Bundle bundle, Bundle other) { bundle.PutAll(other); }