/// <summary> /// Instantiate DonationsFragment. /// </summary> /// <param name="debug"> You can use BuildConfig.DEBUG to propagate the debug flag from your app to the Donations library </param> /// <param name="googleEnabled"> Enabled Google Play donations </param> /// <param name="googlePubkey"> Your Google Play public key </param> /// <param name="googleCatalog"> Possible item names that can be purchased from Google Play </param> /// <param name="googleCatalogValues"> Values for the names </param> /// <param name="paypalEnabled"> Enable PayPal donations </param> /// <param name="paypalUser"> Your PayPal email address </param> /// <param name="paypalCurrencyCode"> Currency code like EUR. See here for other codes: /// https://developer.paypal.com/webapps/developer/docs/classic/api/currency_codes/#id09A6G0U0GYK </param> /// <param name="paypalItemName"> Display item name on PayPal, like "Donation for NTPSync" </param> /// <param name="flattrEnabled"> Enable Flattr donations </param> /// <param name="flattrProjectUrl"> The project URL used on Flattr </param> /// <param name="flattrUrl"> The Flattr URL to your thing. NOTE: Enter without http:// </param> /// <param name="bitcoinEnabled"> Enable bitcoin donations </param> /// <param name="bitcoinAddress"> The address to receive bitcoin </param> /// <returns> DonationsFragment </returns> public static DonationsFragment newInstance(bool debug, bool googleEnabled, string googlePubkey, string[] googleCatalog, string[] googleCatalogValues, bool paypalEnabled, string paypalUser, string paypalCurrencyCode, string paypalItemName, bool flattrEnabled, string flattrProjectUrl, string flattrUrl, bool bitcoinEnabled, string bitcoinAddress) { DonationsFragment donationsFragment = new DonationsFragment(); Bundle args = new Bundle(); args.PutBoolean(ARG_DEBUG, debug); args.PutBoolean(ARG_GOOGLE_ENABLED, googleEnabled); args.PutString(ARG_GOOGLE_PUBKEY, googlePubkey); args.PutStringArray(ARG_GOOGLE_CATALOG, googleCatalog); args.PutStringArray(ARG_GOOGLE_CATALOG_VALUES, googleCatalogValues); args.PutBoolean(ARG_PAYPAL_ENABLED, paypalEnabled); args.PutString(ARG_PAYPAL_USER, paypalUser); args.PutString(ARG_PAYPAL_CURRENCY_CODE, paypalCurrencyCode); args.PutString(ARG_PAYPAL_ITEM_NAME, paypalItemName); args.PutBoolean(ARG_FLATTR_ENABLED, flattrEnabled); args.PutString(ARG_FLATTR_PROJECT_URL, flattrProjectUrl); args.PutString(ARG_FLATTR_URL, flattrUrl); args.PutBoolean(ARG_BITCOIN_ENABLED, bitcoinEnabled); args.PutString(ARG_BITCOIN_ADDRESS, bitcoinAddress); donationsFragment.Arguments = args; return(donationsFragment); }
public void OnEstadoSeleccionado(string[][] ciudades, int[][] logos, string[][] info, int posicion) { FrameLayout contenedor = FindViewById <FrameLayout>(Resource.Id.contenedorFragment); if (contenedor != null) { Bundle args = new Bundle(); args.PutStringArray("ciudades", ciudades[posicion]); args.PutIntArray("logos", logos[posicion]); args.PutStringArray("info", info[posicion]); CiudadesFragment ciudadesFragment = new CiudadesFragment(); ciudadesFragment.Arguments = args; SupportFragmentManager.BeginTransaction().SetCustomAnimations( Resource.Animator.voltear_a_la_derecha_in, Resource.Animator.voltear_a_la_derecha_out, Resource.Animator.voltear_a_la_izquierda, Resource.Animator.voltear_a_la_izquierda_out ).Replace(Resource.Id.contenedorFragment, ciudadesFragment).AddToBackStack(null).Commit(); } else { var ciudadesFragment = SupportFragmentManager.FindFragmentById(Resource.Id.ciudades) as CiudadesFragment; ciudadesFragment.updateCiudades(ciudades[posicion], logos[posicion], info[posicion]); } }
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; }
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) { Intent intent = new Intent(Application.Context, typeof(ChoiceActivity)); 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)) // Dummy, hvis der er en tom Choice liste uden et navn { CallEntity callEntity = CallWrapper.WrapCall(UserData.CPRNR, CallUtil.StatusCode.Active, category); //AppDelegate.MakeCall(callEntity, category.Name, this); } else { Bundle bundle = new Bundle(); bundle.PutStringArray("choices", choiceList.ToArray()); bundle.PutStringArray("details", detailList.ToArray()); bundle.PutString("category", categories[args.Position].Name); intent.PutExtras(bundle); StartActivity(intent); } }; return(view); }
protected override void OnSaveInstanceState(Bundle bundle) { //scaleButton.Enabled = false; //computeButton.Enabled = false; string[][] tdA = CreateStrArrsFromData(); bundle.PutStringArray("TAGS_ARR", tdA[0]); bundle.PutStringArray("DATA_ARR", tdA[1]); bundle.PutParcelable("MEDIA_URI", mediaUri); bundle.PutString("V_VIEW_HEIGHT", vView.Height.ToString()); bundle.PutString("RESULT_TEXT", resultTextView.Text); base.OnSaveInstanceState(bundle); }
public static EventDetailFragment Create(Event ev) { var arguments = new Bundle(); arguments.PutString("titleText", ev.Type + " " + ev.Course.Name + " (" + ev.Course.CatalogNumber + ")"); if (!string.IsNullOrWhiteSpace(ev.Description)) { arguments.PutString("groupText", ev.Description); } else if (ev.Groups.Count > 0) { arguments.PutString("groupText", "Groep " + ev.Groups.First().Identifier); } arguments.PutString("programmeText", ""); arguments.PutString("dateText", ev.StartTime.ToString("ddd ") + ev.StartTime.ToShortDateString()); arguments.PutString("weekText", "Week " + ev.StartTime.GetWeekOfYear()); arguments.PutString("timeText", ev.StartTime.ToShortTimeString() + " - " + ev.EndTime.ToShortTimeString()); var length = ev.Locations.Count; var groupTexts = new string[length]; var staffTexts = new string[length]; var locationTexts = new string[length]; var locationInfo = new string[length]; var capacityTexts = new string[length]; int i = 0; foreach (var location in ev.Locations) { groupTexts[i] = ev.Groups.Count > 0 ? "Groep " + ev.Groups.First().Identifier : ""; staffTexts[i] = ev.Staff.Count > 0 ? ev.Staff.JoinStrings(", ") : ""; locationTexts[i] = location.Name; locationInfo[i] = location.InfoUrl; capacityTexts[i] = ""; i++; } arguments.PutStringArray("groupTexts", groupTexts); arguments.PutStringArray("staffTexts", staffTexts); arguments.PutStringArray("locationTexts", locationTexts); arguments.PutStringArray("locationInfo", locationInfo); arguments.PutStringArray("capacityTexts", capacityTexts); return(new EventDetailFragment { Arguments = arguments }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); // Try to find an existing users file and store all existing users in UsersList. try { using (StreamReader stream = new StreamReader(Application.Context.OpenFileInput("savedUsers"))) { string line; while ((line = stream.ReadLine()) != null) { UsersList.Add(FileHelper.ConvertFileStringToUser(line)); } } } // Do nothing if file does not exist. catch (Exception e) { } Button button = FindViewById <Button>(Resource.Id.addUserButton); // Attach the UserAdapter to convert users to list elements, and to allow the list to update (via NotifyDataSetChanged in OnActivityResult) ListView listView = FindViewById <ListView>(Resource.Id.userList); listView.ItemClick += ListView_ItemClick; listAdapter = new UserAdapter(UsersList); listView.Adapter = listAdapter; // Create a bundle with indexes for a new user's name and password. Also provide a list of strings of all usernames to ensure no duplicates. // All usernames are made lowercase because identical usernames in different cases are considered duplicates, and this makes it easier to check when adding a user. Bundle userBundle = new Bundle(); userBundle.PutString("newUserName", ""); userBundle.PutString("newUserPassword", ""); userBundle.PutStringArray("existingUsers", UsersList.Select(user => user.Username.ToLower()).ToArray()); // Create the AddUserActivity Intent, update the existingUsers list, and start it while expecting a result. button.Click += (sender, e) => { var intent = new Intent(this, typeof(AddUserActivity)); userBundle.PutStringArray("existingUsers", UsersList.Select(user => user.Username).ToArray()); intent.PutExtra("addUserBundle", userBundle); StartActivityForResult(intent, 0); }; }
public static void AddStringArray(this Bundle bundle, string key, Dictionary <string, object> dictionary) { if (dictionary.ContainsKey(key)) { bundle.PutStringArray(key, (string[])dictionary[key]); } }
public void OnEstadoSeleccionado(string[] ciudades) { FrameLayout contenedor = FindViewById <FrameLayout>(Resource.Id.contenedorFragment); if (contenedor != null) { Bundle args = new Bundle(); args.PutStringArray("ciudades", ciudades); CiudadesFragment ciudadesFragment = new CiudadesFragment(); ciudadesFragment.Arguments = args; //SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contenedorFragment, ciudadesFragment).SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentOpen).AddToBackStack(null).Commit(); //SupportFragmentManager.BeginTransaction().SetTransition(Android.Support.V4.App.FragmentTransaction.TransitExitMask).Replace(Resource.Id.contenedorFragment, ciudadesFragment).AddToBackStack(null).Commit(); SupportFragmentManager.BeginTransaction().SetCustomAnimations( Resource.Animator.voltear_a_la_derecha_in, Resource.Animator.voltear_a_la_derecha_out, Resource.Animator.voltear_a_la_izquierda_in, Resource.Animator.voltear_a_la_izquierda_out ).Replace(Resource.Id.contenedorFragment, ciudadesFragment).AddToBackStack(null).Commit(); } else { var ciudadesFragment = SupportFragmentManager.FindFragmentById(Resource.Id.ciudades) as CiudadesFragment; ciudadesFragment.updateCiudades(ciudades); } }
private void FillBundle(Bundle notification) { //For details Push Kit Cross-Platform Xamarin APIs https://developer.huawei.com/consumer/en/doc/ //notification.PutString(NotificationConstants.Ticker, "Optional Ticker"); notification.PutString(NotificationConstants.ChannelId, CoreConstants.NotificationChannelId); //notification.PutString(NotificationConstants.ChannelName, CoreConstants.ChannelName); //notification.PutString(NotificationConstants.ChannelDescription, ""); //notification.PutString(NotificationConstants.RepeatInterval, ""); //notification.PutString(NotificationConstants.SoundName, ""); //notification.PutString(NotificationConstants.Color, "white"); notification.PutStringArray(NotificationConstants.Actions, new string[] { "Yes", "No" }); //notification.PutString(NotificationConstants.Group, "group"); notification.PutString(NotificationConstants.Importance, LocalNotificationConstants.Importance.Max); notification.PutString(NotificationConstants.Priority, Priority.Max); notification.PutString(NotificationConstants.Visibility, Visibility.Public); //notification.PutString(NotificationConstants.LargeIconUrl, "https://developer.huawei.com/Enexport/sites/default/images/en/Develop/hms/push/push2-tuidedao.png"); //notification.PutString(NotificationConstants.Number, "3"); //notification.PutInt(NotificationConstants.Id, 0); //notification.PutInt(NotificationConstants.SmallIcon, Resource.Mipmap.ic_launcher); //notification.PutInt(NotificationConstants.LargeIcon, Resource.Mipmap.ic_launcher_foreground); //notification.PutDouble(NotificationConstants.VibrateDuration, 2500L); //notification.PutBoolean(NotificationConstants.Vibrate, false); //notification.PutBoolean(NotificationConstants.Ongoing, false); //notification.PutBoolean(NotificationConstants.PlaySound, false); //notification.PutBoolean(NotificationConstants.AllowWhileIdle, false); notification.PutBoolean(NotificationConstants.InvokeApp, false); //notification.PutBoolean(NotificationConstants.DontNotifyInForeground, false); //notification.PutBoolean(NotificationConstants.AutoCancel, false); //notification.PutBoolean(NotificationConstants.GroupSummary, false); //notification.PutBoolean(NotificationConstants.OnlyAlertOnce, false); //notification.PutBoolean(NotificationConstants.ShowWhen, true); }
/// <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; }
protected override void OnSaveInstanceState(Bundle outState) { outState.PutStringArray(ExtraProducts, supportedProducts); outState.PutInt(ExtraId, id); outState.PutInt(ExtraFront, front); outState.PutString(ExtraApiKey, apikey); base.OnSaveInstanceState(outState); }
public static void CreateDWProfile(Context context) { sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_CREATE_PROFILE, PROFILE_NAME); // Requires DataWedge 6.4 // Now configure that created profile to apply to our application Bundle profileConfig = new Bundle(); profileConfig.PutString("PROFILE_NAME", PROFILE_NAME); profileConfig.PutString("PROFILE_ENABLED", "true"); // Seems these are all strings profileConfig.PutString("CONFIG_MODE", "UPDATE"); Bundle barcodeConfig = new Bundle(); barcodeConfig.PutString("PLUGIN_NAME", "BARCODE"); barcodeConfig.PutString("RESET_CONFIG", "true"); Bundle barcodeProps = new Bundle(); barcodeProps.PutString("configure_all_scanners", "true"); barcodeProps.PutString("scanner_input_enabled", "true"); barcodeConfig.PutBundle("PARAM_LIST", barcodeProps); profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig); Bundle appConfig = new Bundle(); appConfig.PutString("PACKAGE_NAME", context.PackageName); // Associate the profile with this app appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" }); profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig }); sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig); // You can only configure one plugin at a time, we have done the barcode input, now do the intent output profileConfig.Remove("PLUGIN_CONFIG"); Bundle intentConfig = new Bundle(); intentConfig.PutString("PLUGIN_NAME", "INTENT"); intentConfig.PutString("RESET_CONFIG", "true"); Bundle intentProps = new Bundle(); intentProps.PutString("intent_output_enabled", "true"); intentProps.PutString("intent_action", context.Resources.GetString(Resource.String.activity_intent_filter_action)); intentProps.PutString("intent_delivery", "0"); // StartActivity intentConfig.PutBundle("PARAM_LIST", intentProps); profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig); sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig); // Disable keyboard output profileConfig.Remove("PLUGIN_CONFIG"); Bundle keystrokeConfig = new Bundle(); keystrokeConfig.PutString("PLUGIN_NAME", "KEYSTROKE"); keystrokeConfig.PutString("RESET_CONFIG", "true"); Bundle keystrokeProps = new Bundle(); keystrokeProps.PutString("keystroke_output_enabled", "false"); keystrokeConfig.PutBundle("PARAM_LIST", keystrokeProps); profileConfig.PutBundle("PLUGIN_CONFIG", keystrokeConfig); sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig); }
/// <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); }
private void UpdateProfile() { Bundle profileConfig = new Bundle(); profileConfig.PutString("PROFILE_NAME", PROFILE_NAME); profileConfig.PutString("PROFILE_ENABLED", "true"); // Seems these are all strings profileConfig.PutString("CONFIG_MODE", "UPDATE"); Bundle barcodeConfig = new Bundle(); barcodeConfig.PutString("PLUGIN_NAME", "BARCODE"); barcodeConfig.PutString("RESET_CONFIG", "true"); // This is the default but never hurts to specify // QUI SI IMPOSTANO LE PROPRIETA' DELLO SCANNER Bundle barcodeProps = new Bundle(); barcodeProps.PutString("scanner_input_enabled", "true"); barcodeProps.PutString("scanner_selection", "auto"); // Could also specify a number here, the id returned from ENUMERATE_SCANNERS. // Do NOT use "Auto" here (with a capital 'A'), it must be lower case. barcodeProps.PutString("decoder_ean8", "true"); barcodeProps.PutString("decoder_ean13", "true"); barcodeProps.PutString("decoder_code39", "true"); barcodeProps.PutString("decoder_code128", "true"); barcodeProps.PutString("decoder_upca", "true"); barcodeProps.PutString("decoder_upce0", "true"); barcodeProps.PutString("decoder_upce1", "true"); barcodeProps.PutString("decoder_d2of5", "true"); barcodeProps.PutString("decoder_i2of5", "true"); barcodeProps.PutString("decoder_aztec", "true"); barcodeProps.PutString("decoder_pdf417", "true"); barcodeProps.PutString("decoder_qrcode", "true"); barcodeConfig.PutBundle("PARAM_LIST", barcodeProps); profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig); Bundle appConfig = new Bundle(); appConfig.PutString("PACKAGE_NAME", this.PackageName); // Associate the profile with this app appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" }); profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig }); SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, EXTRA_SET_CONFIG, profileConfig); // You can only configure one plugin at a time, we have done the barcode input, now do the intent output profileConfig.Remove("PLUGIN_CONFIG"); Bundle intentConfig = new Bundle(); intentConfig.PutString("PLUGIN_NAME", "INTENT"); intentConfig.PutString("RESET_CONFIG", "true"); Bundle intentProps = new Bundle(); intentProps.PutString("intent_output_enabled", "true"); // intentProps.PutString("intent_action", DataWedgeReceiver.IntentAction); // We can use this when we're going to define the DataWedgeReceiver class intentProps.PutString("intent_action", "barcodescanner.RECVR"); intentProps.PutString("intent_delivery", "2"); intentConfig.PutBundle("PARAM_LIST", intentProps); profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig); SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, EXTRA_SET_CONFIG, profileConfig); }
public static Bundle MakeMessagingStartArgs(string appId, string uuid, string userName, string[] targetUserIds) { Bundle args = new Bundle(); args.PutBoolean("start", true); args.PutString("appId", appId); args.PutString("uuid", uuid); args.PutString("userName", userName); args.PutStringArray("targetUserIds", targetUserIds); return(args); }
public override long Run(com.android.vending.billing.IMarketBillingService service) { Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS"); request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds); Bundle response = service.SendBillingRequest(request); logResponseCode("confirmNotifications", response); return(response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID)); }
public static PermissionHelperDialogFragment NewInstance(string[] permissions) { var args = new Bundle(); args.PutStringArray(PermissionsKey, permissions); var fragment = new PermissionHelperDialogFragment { Arguments = args }; return(fragment); }
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) { var resultData = new Bundle(); resultData.PutStringArray(PermissionsHelper.KeyPermissions, permissions); resultData.PutIntArray(PermissionsHelper.KeyGrants, grantResults.Select(gr => (int)gr).ToArray()); _resultReceiver.Send((Result)_requestCode, resultData); base.OnRequestPermissionsResult(requestCode, permissions, grantResults); Finish(); }
public static ConfirmationDialogFragment NewInstance(int message, String[] permissions, int requestCode, int notGrantedMessage) { ConfirmationDialogFragment fragment = new ConfirmationDialogFragment(); Bundle args = new Bundle(); args.PutInt(ARG_MESSAGE, message); args.PutStringArray(ARG_PERMISSIONS, permissions); args.PutInt(ARG_REQUEST_CODE, requestCode); args.PutInt(ARG_NOT_GRANTED_MESSAGE, notGrantedMessage); fragment.Arguments = args; return(fragment); }
private void OnShowMonthlyPlanForSelectedItems() { shouldStartUpdaterOnResume = false; var intent = new Intent(this, typeof(MonthlyPlanActivity)); var bundle = new Bundle(); bundle.PutStringArray(AppConstant.SelectedGoals, adapter.SelectedGoals.Select(g => g.Id.ToString()).ToArray()); intent.PutExtra(AppConstant.SelectedGoalsBundle, bundle); StartActivityForResult(intent, 3952); OverridePendingTransition(Resource.Animation.abc_fade_in, Resource.Animation.abc_fade_out); }
public override void Run() { try { ISharedPreferences mSharedPreference = context.GetSharedPreferences(Constant.Com_Fra, FileCreationMode.WorldWriteable); IEnvManagerSvr newinfo = RometeClientManager.GetClient(PsPropertiesUtil.GetProperties(context, "loadinfoUrl"), typeof(IEnvManagerSvr), 60000) as IEnvManagerSvr; AppEnvironment appenvironment = newinfo.GetUserEnv(mSharedPreference.GetString(Constant.PS_UTAG, ""), 0); Message msg = context.mainhandler.ObtainMessage(); Bundle bundle = new Bundle(); bundle.PutString("HeaderURL", appenvironment.MainPage.HeadUrl); bundle.PutInt("HeaderHeight", appenvironment.MainPage.HeadHeight); bundle.PutString("LoadImg", appenvironment.SplashImg); ObjList list = appenvironment.MainPage.FuncDefs; string[] funsname = new string[list.Count]; string[] funurl = new string[list.Count]; string[] funiconurl = new string[list.Count]; string[] funsbdnurl = new string[list.Count]; for (int i = 0; i < list.Count; i++) { funsname[i] = (list[i] as FuncEntry).Title; funurl[i] = (list[i] as FuncEntry).Url; funiconurl[i] = (list[i] as FuncEntry).IconUrl; funsbdnurl[i] = (list[i] as FuncEntry).StateUrl; } bundle.PutStringArray("funsname", funsname); bundle.PutStringArray("funsurl", funurl); bundle.PutStringArray("funsiconurl", funiconurl); bundle.PutStringArray("funsbdnurl", funsbdnurl); msg.Data = bundle; msg.What = 1; msg.Target = context.mainhandler; msg.SendToTarget(); } catch (System.Exception e) { throw; } }
public Bundle BuildBundle() { Bundle bundle = new Bundle(); bundle.PutInt("CurrentPageIndex", CurrentPageIndex); bundle.PutString("Site", Site); //User Information bundle.PutString("User", User); bundle.PutString("Password", Password); bundle.PutString("UserDesc", UserDesc); bundle.PutString("EmpNum", EmpNum); bundle.PutString("EmpName", EmpName); bundle.PutString("Currency", Currency); bundle.PutString("DefaultWarehouse", DefaultWarehouse); bundle.PutString("DefaultLocation", DefaultLocation); bundle.PutString("QuantityFormat", QuantityFormat); bundle.PutString("AmountFormat", AmountFormat); //Login Configurations bundle.PutString("Token", Token); bundle.PutString("Theme", Theme); bundle.PutString("CSIWebServerName", CSIWebServerName); bundle.PutBoolean("EnableHTTPS", EnableHTTPS); bundle.PutString("Configuration", Configuration); bundle.PutStringArray("ConfigurationList", ConfigurationList.ToArray()); bundle.PutString("RecordCap", RecordCap); bundle.PutBoolean("SaveUser", SaveUser); bundle.PutString("SavedUser", SavedUser); bundle.PutBoolean("SavePassword", SavePassword); bundle.PutString("SavedPassword", SavedPassword); bundle.PutBoolean("UseRESTForRequest", UseRESTForRequest); bundle.PutBoolean("LoadPicture", LoadPicture); bundle.PutBoolean("ForceAutoPost", ForceAutoPost); bundle.PutBoolean("ShowSuccessMessage", ShowSuccessMessage); bundle.PutBoolean("DisplayWhenError", DisplayWhenError); //Passed Key Information bundle.PutString("Key", Key); bundle.PutString("LineSuffix", LineSuffix); bundle.PutString("Release", Release); bundle.PutString("Key2", Key2); bundle.PutString("LineSuffix2", LineSuffix2); bundle.PutString("Release2", Release2); //License bundle.PutString("LicenseString", LicenseString); bundle.PutString("ExpDate", ExpDate); return(bundle); }
void OnItemClick(object sender, int position) { var intent = new Intent(this, typeof(DemiSecondActivity)); Bundle b = new Bundle(); b.PutInt("CategoryID", (int)mProductList[position].category); b.PutStringArray("lijst", ListOfProducts.ToArray()); intent.PutExtras(b); //Toast.MakeText(this, "This is in category " + mProductList[position].category, ToastLength.Short).Show(); StartActivity(intent); }
public override long Run(com.android.vending.billing.IMarketBillingService service) { mNonce = Security.generateNonce(); Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION"); request.PutLong(Consts.BILLING_REQUEST_NONCE, mNonce); request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds); Bundle response = service.SendBillingRequest(request); logResponseCode("getPurchaseInformation", response); return(response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID)); }
public static AddWalletDialogFragment NewInstance(string[] networkProviders, WalletInfo wallet = null, bool edit = false) { AddWalletDialogFragment fragment = new AddWalletDialogFragment(); Bundle bundle = new Bundle(); bundle.PutStringArray("networks", networkProviders); bundle.PutBoolean("edit", edit); if (wallet != null) { bundle.PutString("wallet", JsonConvert.SerializeObject(wallet)); } fragment.Arguments = bundle; return(fragment); }
private void CreateProfile() { String profileName = PROFILE_NAME; SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, CREATE_PROFILE, profileName); // Now configure that created profile to apply to our application Bundle profileConfig = new Bundle(); profileConfig.PutString("PROFILE_NAME", PROFILE_NAME); profileConfig.PutString("PROFILE_ENABLED", "true"); // Seems these are all strings profileConfig.PutString("CONFIG_MODE", "UPDATE"); Bundle barcodeConfig = new Bundle(); barcodeConfig.PutString("PLUGIN_NAME", "BARCODE"); barcodeConfig.PutString("RESET_CONFIG", "true"); // This is the default but never hurts to specify Bundle barcodeProps = new Bundle(); barcodeConfig.PutBundle("PARAM_LIST", barcodeProps); profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig); Bundle appConfig = new Bundle(); appConfig.PutString("PACKAGE_NAME", Android.App.Application.Context.PackageName); // Associate the profile with this app appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" }); profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig }); SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig); // You can only configure one plugin at a time, we have done the barcode input, now do the intent output profileConfig.Remove("PLUGIN_CONFIG"); Bundle intentConfig = new Bundle(); intentConfig.PutString("PLUGIN_NAME", "INTENT"); intentConfig.PutString("RESET_CONFIG", "true"); Bundle intentProps = new Bundle(); intentProps.PutString("intent_output_enabled", "true"); intentProps.PutString("intent_action", DataWedgeReceiver.IntentAction); intentProps.PutString("intent_delivery", "2"); intentConfig.PutBundle("PARAM_LIST", intentProps); profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig); SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig); }
/// <summary> /// インテント送信用メッセージバンドルを生成。 /// </summary> /// <param name="messageUid">バンドルメッセージ作成元となるメッセージUID。</param> /// <param name="message">バンドルメッセージ作成元となる<see cref="MimeMessage"/></param> /// <returns>引数のmessageをもとに作成したバンドル。</returns> private Bundle CreateBundleMessage(string messageUid, MimeMessage message) { string textBody; if (message.TextBody != null) { textBody = message.TextBody; } else if (message.HtmlBody != null) { // HTML形式の場合はテキストに変換する textBody = HtmlConverter.HtmlToText(message.HtmlBody); } else { textBody = ""; } // 文末の返信ボタン用文字列を抽出 var m = BUTTONS_REGEX.Match(textBody); string[] buttons; if (m.Success) { buttons = m.Groups["button"].Captures.Cast <Capture>().Select(c => c.Value).ToArray(); // 返信用ボタン文字列を本文から除去 textBody = textBody.Substring(0, m.Index); } else { buttons = new string[0]; } var bundleMessage = new Bundle(); bundleMessage.PutString(Constants.BUNDLE_MAIL_MESSAGE_UID, messageUid); bundleMessage.PutString(Constants.BUNDLE_MAIL_SUBJECT, message.Subject ?? ""); bundleMessage.PutString(Constants.BUNDLE_MAIL_BODY, textBody); bundleMessage.PutString(Constants.BUNDLE_MAIL_FROM_ADDRESS, ((MailboxAddress)message.From[0]).Address); bundleMessage.PutString(Constants.BUNDLE_MAIL_FROM_NAME, ((MailboxAddress)message.From[0]).Name); bundleMessage.PutStringArray(Constants.BUNDLE_MAIL_REPLY_BUTTONS, buttons); return(bundleMessage); }
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); }
public bool SetStringArray(string[]?value, string?key = null) { if (string.IsNullOrWhiteSpace(key)) { throw new ArgumentException("Value cannot be null or whitespace.", nameof(key)); } var existingValue = GetStringArray(key: key); if (!ReferenceEquals(existingValue, value) || !ContainsKey(key)) { _bundle.PutStringArray(key, value); OnPropertyChanged(key); return(true); } return(false); }
/// <inheritdoc /> public bool SetStringArray(string[]?value, [CallerMemberName] string?key = null) { if (key == null) { throw new ArgumentNullException(nameof(key)); } var existingValue = GetStringArray(key: key); if (!ReferenceEquals(existingValue, value) || !ContainsKey(key)) { _bundle.PutStringArray(key, value); OnPropertyChanged(key); return(true); } return(false); }
// 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); }
public void SetConfig(IEMDKScannerConfig cnf) { ZebraScannerConfig config = (ZebraScannerConfig)cnf; Bundle profileConfig = new Bundle(); profileConfig.PutString("PROFILE_NAME", PROFILE_NAME); profileConfig.PutString("PROFILE_ENABLED", m_bRegistered ? "true" : "false"); // Seems these are all strings profileConfig.PutString("CONFIG_MODE", "UPDATE"); Bundle barcodeConfig = new Bundle(); barcodeConfig.PutString("PLUGIN_NAME", "BARCODE"); barcodeConfig.PutString("RESET_CONFIG", "false"); // This is the default but never hurts to specify Bundle barcodeProps = new Bundle(); barcodeProps.PutString("scanner_input_enabled", "true"); barcodeProps.PutString("scanner_selection", "auto"); // Could also specify a number here, the id returned from ENUMERATE_SCANNERS. // Do NOT use "Auto" here (with a capital 'A'), it must be lower case. barcodeProps.PutString("decoder_ean8", config.IsEAN8 ? "true" : "false"); barcodeProps.PutString("decoder_ean13", config.IsEAN13 ? "true" : "false"); barcodeProps.PutString("decoder_code39", config.IsCode39 ? "true" : "false"); barcodeProps.PutString("decoder_code128", config.IsCode128 ? "true" : "false"); barcodeProps.PutString("decoder_upca", config.IsUPCA ? "true" : "false"); barcodeProps.PutString("decoder_upce0", config.IsUPCE0 ? "true" : "false"); barcodeProps.PutString("decoder_upce1", config.IsUPCE1 ? "true" : "false"); barcodeProps.PutString("decoder_d2of5", config.IsD2of5 ? "true" : "false"); barcodeProps.PutString("decoder_i2of5", config.IsI2of5 ? "true" : "false"); barcodeProps.PutString("decoder_aztec", config.IsAztec ? "true" : "false"); barcodeProps.PutString("decoder_pdf417", config.IsPDF417 ? "true" : "false"); barcodeProps.PutString("decoder_qrcode", config.IsQRCode ? "true" : "false"); barcodeConfig.PutBundle("PARAM_LIST", barcodeProps); profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig); Bundle appConfig = new Bundle(); appConfig.PutString("PACKAGE_NAME", Android.App.Application.Context.PackageName); // Associate the profile with this app appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" }); profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig }); SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig); }
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); }
// 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; }
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); }
public void ToBundle(Bundle b) { b.PutStringArray(Key, Value); }