public static void OnRefresh(Account account) { var extras = new Bundle(); //http://catinean.com/2014/08/03/force-your-syncadapter-to-sync/ to force resync extras.PutBoolean(ContentResolver.SyncExtrasManual, true); extras.PutBoolean(ContentResolver.SyncExtrasExpedited, true); ContentResolver.RequestSync(account, SyncHelper.CONTENT_AUTHORITY, extras); }
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); }
/** * Return an instance of TimeFragment with its bundle filled with the * constructor arguments. The values in the bundle are retrieved in * {@link #onCreateView()} below to properly initialize the TimePicker. * * @param theme * @param hour * @param minute * @param isClientSpecified24HourTime * @param is24HourTime * @return */ public static TimeFragment NewInstance(int Theme, int Hour, int Minute,bool IsClientSpecified24HourTime, bool Is24HourTime) { TimeFragment timeFragment = new TimeFragment(); Bundle bundle = new Bundle(); bundle.PutInt("theme", Theme); bundle.PutInt("hour", Hour); bundle.PutInt("minute", Minute); bundle.PutBoolean("isClientSpecified24HourTime", IsClientSpecified24HourTime); bundle.PutBoolean("is24HourTime", Is24HourTime); timeFragment.Arguments=bundle; return timeFragment; }
public static TimeFragment NewInstance(int theme,int hour,int minute, bool isClientSpecified24HourTime,bool is24HourTime) { TimeFragment t = new TimeFragment (); Bundle b = new Bundle (); b.PutInt ("theme", theme); b.PutInt ("hour", hour); b.PutInt ("minute", minute); b.PutBoolean ("isClientSpecified24HourTime", isClientSpecified24HourTime); b.PutBoolean ("is24HourTime", is24HourTime); t.Arguments = b; return t; }
public static SimpleDialogFragment Instance(string title, string textValue, bool html = false, bool okay = false) { SimpleDialogFragment d = new SimpleDialogFragment (); Bundle args = new Bundle (); args.PutString (StringVarConsts.EXTRA_TITLE, title); args.PutString (StringVarConsts.EXTRA_TEXT_1, textValue); args.PutBoolean (StringVarConsts.EXTRA_HTML_FLAG, html); args.PutBoolean (StringVarConsts.EXTRA_OK_FLAG, okay); d.Arguments = args; return d; }
void listView_ItemClick(object sender, AdapterView.ItemLongClickEventArgs e){ // content to pass var bundle1 = new Bundle(); LichHoc lh = BLichHoc.GetLH(SQLite_Android.GetConnection (),listCT[e.Position].Id); bundle1.PutString ("MH", lh.Id); bundle1.PutBoolean ("isLHT", false); bundle1.PutBoolean ("check", false); bundle1.PutString ("Thu", listCT [e.Position].Thu); bundle1.PutString ("TietBD", listCT [e.Position].TietBatDau); Intent myintent = new Intent (Activity, typeof(Remider)); myintent.PutExtra ("RemindValue", bundle1); StartActivity (myintent); }
public static SignInFragment Create(bool edit) { var args = new Bundle(); args.PutBoolean(ArgEdit, edit); var fragment = new SignInFragment(); fragment.Arguments = args; return fragment; }
public override void OnSaveInstanceState(Bundle outState) { outState.PutBoolean("CheckBox", _checkBox.Enabled); outState.PutString("EditText", _editText.Text); base.OnSaveInstanceState(outState); }
protected override void OnSaveInstanceState(Bundle outState) { if (IsViewPagerActive()) { outState.PutBoolean(IsLockedArgument, viewPager.IsLocked); } base.OnSaveInstanceState(outState); }
public override void Start() { Bundle hints = new Bundle(); foreach (Symbology symbology in _enabled) { switch (symbology) { case Symbology.UPCE: hints.PutBoolean(DO_UPCE, true); break; case Symbology.EAN8: hints.PutBoolean(DO_EAN8, true); break; case Symbology.EAN13: hints.PutBoolean(DO_EAN13, true); break; case Symbology.Code39: hints.PutBoolean(DO_CODE93, true); break; case Symbology.Code93: hints.PutBoolean(DO_CODE39, true); break; case Symbology.Code128: hints.PutBoolean(DO_CODE128, true); break; case Symbology.Sticky: hints.PutBoolean(DO_STICKY, true); break; case Symbology.UPCA: break; default: break; } } hints.PutString(DO_BROADCAST_TO, RedLaserScanReceiver.BROADCAST_ACTION); Intent i = new Intent(); i.SetAction("com.target.redlasercontainer.SCAN"); i.PutExtras(hints); Log.Info("BarcodeScanning", "broadcast intent with action com.target.redlasercontainter.SCAN sent"); try { _context.SendBroadcast(i); } catch (Exception ex) { Log.Error("BarcodeScanning", ex.Message); } }
public static BookingsTabFragment NewInstance(int position, bool workshop) { var f = new BookingsTabFragment(); var b = new Bundle(); b.PutInt("position", position); b.PutBoolean("isWorkshop", workshop); f.Arguments = b; return f; }
public static void SetSlotReservationFlags(Bundle extras, bool reservePlayingQueueSlot, bool reserveSkipToNextSlot, bool reserveSkipToPrevSlot) { if (reservePlayingQueueSlot) { extras.PutBoolean(SlotReservationQueue, true); } else { extras.Remove(SlotReservationQueue); } if (reserveSkipToPrevSlot) { extras.PutBoolean(SlotReservationSkipToPrev, true); } else { extras.Remove(SlotReservationSkipToPrev); } if (reserveSkipToNextSlot) { extras.PutBoolean(SlotReservationSkipToNext, true); } else { extras.Remove(SlotReservationSkipToNext); } }
public static RegisterCMFragment NewInstance(String email, bool IsUpdate) { var fragment = new RegisterCMFragment (); var args = new Bundle (); args.PutString (EMAIL, email); args.PutBoolean (ISUDAPE, IsUpdate); fragment.Arguments = args; return fragment; }
protected override void OnSaveInstanceState(Bundle outState) { outState.PutBoolean ("showLogin", this.showLogin); if (ActionBar.SelectedTab != null) outState.PutString ("selected", (string)ActionBar.SelectedTab.Tag); base.OnSaveInstanceState (outState); }
public static Android.Support.V4.App.Fragment newInstance(MainActivity context, int pos, float scale,bool IsBlured) { Bundle b = new Bundle(); b.PutInt("pos", pos); b.PutFloat("scale", scale); b.PutBoolean("IsBlured", IsBlured); MyFragment myf = new MyFragment (); return Android.Support.V4.App.Fragment.Instantiate (context,myf.Class.Name, b); }
void listView_ItemClick(object sender, AdapterView.ItemLongClickEventArgs e){ // content to pass to dialog fragment var bundle1 = new Bundle(); bundle1.PutString ("MH", list[e.Position].MaMH); bundle1.PutBoolean ("check", true); bundle1.PutString ("NamHoc", list[e.Position].NamHoc); bundle1.PutString ("HocKy", list[e.Position].HocKy); Intent myintent = new Intent (Activity, typeof(Remider)); myintent.PutExtra ("RemindValue", bundle1); StartActivity (myintent); }
/** * <p>Return a new instance of {@code SlideDateTimeDialogFragment} with its bundle * filled with the incoming arguments.</p> * * <p>Called by {@link SlideDateTimePicker#show()}.</p> * * @param listener * @param initialDate * @param minDate * @param maxDate * @param isClientSpecified24HourTime * @param is24HourTime * @param theme * @param indicatorColor * @return */ public static SlideDateTimeDialogFragment NewInstance(SlideDateTimeListener Listener,Date InitialDate, Date MinDate, Date MaxDate, bool IsClientSpecified24HourTime,bool Is24HourTime, int Theme, int IndicatorColor) { _listener = Listener; // Create a new instance of SlideDateTimeDialogFragment SlideDateTimeDialogFragment dialogFragment = new SlideDateTimeDialogFragment(); // Store the arguments and attach the bundle to the fragment Bundle bundle = new Bundle(); bundle.PutSerializable("initialDate", InitialDate); bundle.PutSerializable("minDate", MinDate); bundle.PutSerializable("maxDate", MaxDate); bundle.PutBoolean("isClientSpecified24HourTime", IsClientSpecified24HourTime); bundle.PutBoolean("is24HourTime", Is24HourTime); bundle.PutInt("theme", Theme); bundle.PutInt("indicatorColor", IndicatorColor); dialogFragment.Arguments=bundle; // Return the fragment with its bundle return dialogFragment; }
public static WebViewDialog Instance(string title, string url, bool okay = false) { WebViewDialog d = new WebViewDialog (); Bundle args = new Bundle (); args.PutString (StringVarConsts.EXTRA_TITLE, title); args.PutString (StringVarConsts.EXTRA_URL, url); args.PutBoolean (StringVarConsts.EXTRA_OK_FLAG, okay); d.Arguments = args; return d; }
public static DetailsShowSeasonListFragment NewInstance(TVShow show, int index, bool highlightSelectedIndex) { DetailsShowSeasonListFragment frag = new DetailsShowSeasonListFragment(); Bundle args = new Bundle(); string serializedShow = JsonConvert.SerializeObject(show); args.PutString("myShowString", serializedShow); args.PutInt("index", index); args.PutBoolean("highlight", highlightSelectedIndex); frag.Arguments = args; return frag; }
public static void clearAndExit(Context ctx) { if (ctx != new MainActivity()) { Intent intent = new Intent(ctx, typeof(MainActivity)); intent.SetFlags(ActivityFlags.ClearTop); Bundle bundle = new Bundle(); bundle.PutBoolean("exit", true); intent.PutExtras(bundle); ctx.StartActivity(intent); } else { ((Activity)ctx).Finish(); } }
private async void ClickFunction() { //get imei var telephonyManager = (TelephonyManager) GetSystemService(TelephonyService); string imei = telephonyManager.DeviceId; //if no imei use androidid if (String.IsNullOrEmpty (imei)) { imei = Settings.Secure.GetString (ContentResolver,Settings.Secure.AndroidId); } Console.Error.WriteLine ("imei:"+imei); //if imei not empty proceed if (!String.IsNullOrEmpty (imei)) { try { var json_validateEventCode = await Task.Factory.StartNew (() => Webservice.ws_validateEventCode (et_eventCode.Text, imei, uid)); Webservice.validateEventCode data = JsonConvert.DeserializeObject<Webservice.validateEventCode> (json_validateEventCode); //hide loading and show send button pb.Visibility = ViewStates.Invisible; btn_send.Visibility = ViewStates.Visible; if (data.success == 1) { //disable button to prevent double click RunOnUiThread (() => { btn_send.Enabled = false; }); //database save quizdata QuizDB quizDB = new QuizDB (); quizDB.completion_Stat = 0; quizDB.event_Code = event_code; quizDB.user_id = uid; quizDB.event_Id = data.event_id; try { DB_access.saveData (quizDB); } catch { } //loop and store question and answer into list foreach (var temp in data.quizs) { if (temp.answer == 0) { QuestionAnswer.answerList.Add (false); } else { QuestionAnswer.answerList.Add (true); } QuestionAnswer.questionList.Add (temp.question); } //bundle to be sent for question fragment Bundle msg = new Bundle (); msg.PutInt ("currentQuestion", 1); msg.PutBoolean ("anwser", QuestionAnswer.answerList [0]); msg.PutString ("user_id", uid); msg.PutInt ("event_id", data.event_id); msg.PutString ("imei", imei); FragmentTransaction transaction = FragmentManager.BeginTransaction (); dialog_Signup signUpDialog = new dialog_Signup (); signUpDialog.Arguments = msg; signUpDialog.Cancelable = false; signUpDialog.Show (transaction, "dialog fragment"); } else if (data.success == 0) { Snackbar snackbar = Snackbar .Make (btn_send, "Kod penyertaan salah. Sila semak semula.", Snackbar.LengthLong) .SetAction ("OK", delegate { }); View snackbarView = snackbar.View; TextView tv = (TextView)snackbarView.FindViewById (Resource.Id.snackbar_text); tv.SetTextColor (Color.White); snackbar.Show (); } else if (data.success == 3) { AlertDialog.Builder alert = new AlertDialog.Builder (this); alert.SetTitle ("Quiz telah ditutup!"); alert.SetCancelable (false); alert.SetPositiveButton ("OK", (senderAlert, args) => { Finish (); }); RunOnUiThread (() => { alert.Show (); }); } else if (data.success == 2) { Snackbar snackbar = Snackbar .Make (btn_send, "Hanya satu penyertaan bagi setiap akaun/gajet", Snackbar.LengthLong) .SetAction ("OK", delegate { }); View snackbarView = snackbar.View; TextView tv = (TextView)snackbarView.FindViewById (Resource.Id.snackbar_text); tv.SetTextColor (Color.White); snackbar.Show (); } } catch (Exception ex) { Console.Error.WriteLine ("ex" + ex); AlertDialog.Builder alert = new AlertDialog.Builder (this); alert.SetTitle ("Ralat! Sila cuba sebentar lagi. "); alert.SetCancelable (false); alert.SetPositiveButton ("OK", (senderAlert, args) => { }); RunOnUiThread (() => { alert.Show (); }); //hide loading and show send button pb.Visibility = ViewStates.Invisible; btn_send.Visibility = ViewStates.Visible; } } else { //if no imei/android,cannot proceed Snackbar snackbar = Snackbar .Make (btn_send, "Ralat! Gajet anda tiada imei/androidid", Snackbar.LengthLong) .SetAction ("OK", delegate { }); View snackbarView = snackbar.View; TextView tv = (TextView)snackbarView.FindViewById (Resource.Id.snackbar_text); tv.SetTextColor (Color.White); snackbar.Show (); } }
protected override void OnSaveInstanceState (Bundle outState) { outState.PutBoolean (KEY_NEW_CODE_REQUIRED, mServerAuthCodeRequired.Get ()); }
/// <summary> /// Called to retrieve per-instance state from an activity before being killed /// so that the state can be restored in <c><see cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /></c> or /// <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c> (the <c><see cref="T:Android.OS.Bundle" /></c> populated by this method /// will be passed to both). /// </summary> /// <param name="outState">Bundle in which to place your saved state.</param> /// <since version="Added in API level 1" /> /// <altmember cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnPause" /> /// <remarks><para tool="javadoc-to-mdoc">Called to retrieve per-instance state from an activity before being killed /// so that the state can be restored in <c><see cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /></c> or /// <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c> (the <c><see cref="T:Android.OS.Bundle" /></c> populated by this method /// will be passed to both). /// </para> /// <para tool="javadoc-to-mdoc">This method is called before an activity may be killed so that when it /// comes back some time in the future it can restore its state. For example, /// if activity B is launched in front of activity A, and at some point activity /// A is killed to reclaim resources, activity A will have a chance to save the /// current state of its user interface via this method so that when the user /// returns to activity A, the state of the user interface can be restored /// via <c><see cref="M:Android.App.Activity.OnCreate(Android.OS.Bundle)" /></c> or <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c>. /// </para> /// <para tool="javadoc-to-mdoc">Do not confuse this method with activity lifecycle callbacks such as /// <c><see cref="M:Android.App.Activity.OnPause" /></c>, which is always called when an activity is being placed /// in the background or on its way to destruction, or <c><see cref="M:Android.App.Activity.OnStop" /></c> which /// is called before destruction. One example of when <c><see cref="M:Android.App.Activity.OnPause" /></c> and /// <c><see cref="M:Android.App.Activity.OnStop" /></c> is called and not this method is when a user navigates back /// from activity B to activity A: there is no need to call <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c> /// on B because that particular instance will never be restored, so the /// system avoids calling it. An example when <c><see cref="M:Android.App.Activity.OnPause" /></c> is called and /// not <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c> is when activity B is launched in front of activity A: /// the system may avoid calling <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c> on activity A if it isn't /// killed during the lifetime of B since the state of the user interface of /// A will stay intact. /// </para> /// <para tool="javadoc-to-mdoc">The default implementation takes care of most of the UI per-instance /// state for you by calling <c><see cref="M:Android.Views.View.OnSaveInstanceState" /></c> on each /// view in the hierarchy that has an id, and by saving the id of the currently /// focused view (all of which is restored by the default implementation of /// <c><see cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /></c>). If you override this method to save additional /// information not captured by each individual view, you will likely want to /// call through to the default implementation, otherwise be prepared to save /// all of the state of each view yourself. /// </para> /// <para tool="javadoc-to-mdoc">If called, this method will occur before <c><see cref="M:Android.App.Activity.OnStop" /></c>. There are /// no guarantees about whether it will occur before or after <c><see cref="M:Android.App.Activity.OnPause" /></c>.</para> /// <para tool="javadoc-to-mdoc"> /// <format type="text/html"> /// <a href="http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)" target="_blank">[Android Documentation]</a> /// </format> /// </para></remarks> protected override void OnSaveInstanceState(Bundle outState) { outState.PutBoolean("ran", true); outState.PutString(MediaStore.MediaColumns.Title, _title); outState.PutString(MediaStore.Images.ImageColumns.Description, _description); outState.PutInt(ExtraId, _id); outState.PutString(ExtraType, _type); outState.PutString(ExtraAction, _action); outState.PutInt(MediaStore.ExtraDurationLimit, _seconds); outState.PutInt(MediaStore.ExtraVideoQuality, (int) _quality); outState.PutBoolean(ExtraTasked, _tasked); if (_path != null) outState.PutString(ExtraPath, _path.Path); base.OnSaveInstanceState(outState); }
override protected void OnSaveInstanceState(Bundle outState) { base.OnSaveInstanceState(outState); outState.PutBoolean(STATE_SHARING, mSharing); }
protected override void OnSaveInstanceState (Bundle outState) { outState.PutBoolean (KEY_REQUESTING_LOCATION_UPDATES, mRequestingLocationUpdates); outState.PutParcelable (KEY_LOCATION, mCurrentLocation); outState.PutString (KEY_LAST_UPDATED_TIME_STRING, mLastUpdateTime); base.OnSaveInstanceState (outState); }
protected override void OnSaveInstanceState(Bundle outState) { outState.PutBoolean(Constants.SERVICE_STARTED_KEY, isStarted); base.OnSaveInstanceState(outState); }
protected override void OnSaveInstanceState(Bundle outState) { outState.PutBoolean ("clicked", this.wasClicked); base.OnSaveInstanceState (outState); }
private void btnNextQuestion_Click (object sender, EventArgs e) { Dismiss (); if (currentQuestion <= (QuestionAnswer.questionList.Count-1)) { Bundle msg = new Bundle (); msg.PutInt ("currentQuestion", currentQuestion + 1); msg.PutBoolean ("anwser", QuestionAnswer.answerList[currentQuestion]); FragmentTransaction transaction = FragmentManager.BeginTransaction (); dialog_Signup signUpDialog = new dialog_Signup (); signUpDialog.Arguments = msg; signUpDialog.Cancelable = false; signUpDialog.Show (transaction, "dialog fragment"); } }
protected override void OnSaveInstanceState (Bundle outState) { base.OnSaveInstanceState (outState); outState.PutBoolean (KEY_IS_RESOLVING, mIsResolving); outState.PutBoolean (KEY_SHOULD_RESOLVE, mIsResolving); }
public override void OnSaveInstanceState (Bundle outState) { outState.PutBoolean (UseDraftKey, useDraft); base.OnSaveInstanceState (outState); }