本文整理汇总了C#中Bundle.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.GetInt方法的具体用法?C# Bundle.GetInt怎么用?C# Bundle.GetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.GetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnActivityCreated
public override void OnActivityCreated(Bundle savedInstanceState)
{
base.OnActivityCreated(savedInstanceState);
//Current position should survive screen rotations.
if (savedInstanceState != null)
{
mCategory = savedInstanceState.GetInt("category");
mCurPosition = savedInstanceState.GetInt("listPosition");
}
PopulateTitles(mCategory);
ListView lv = ListView;
lv.ChoiceMode = ChoiceMode.Single;
lv.CacheColorHint = Color.Transparent;
lv.ItemLongClick += (o, e) =>
{
String title = (String)((TextView)e.View).Text;
// Set up clip data with the category||entry_id format.
String textData = String.Format("{0}||{1}", mCategory, e.Position);
ClipData data = ClipData.NewPlainText(title, textData);
e.View.StartDrag(data, new MyDragShadowBuilder(e.View), null, 0);
};
SelectPosition(mCurPosition);
}
示例2: Server
public Server(Bundle b)
: this(b.GetInt("SERVER_ID"),
b.GetString("SERVER_NAME"),
b.GetString("SERVER_SCHEME"),
b.GetString("SERVER_HOSTNAME"),
b.GetInt("SERVER_PORT"),
b.GetString("SERVER_USER"),
b.GetString("SERVER_PASS"),
b.GetInt("SERVER_GID"))
{
}
示例3: OnCreate
public override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
if (savedInstanceState != null) {
digitsEntered = savedInstanceState.GetInt (DigitsEnteredKey, digitsEntered);
newDuration = new Duration (
savedInstanceState.GetInt (NewDurationHoursKey, newDuration.Hours),
savedInstanceState.GetInt (NewDurationMinutesKey, newDuration.Minutes));
}
oldDuration = GetDuration ();
}
示例4: OnCreate
public override void OnCreate (Bundle state)
{
base.OnCreate (state);
if (state != null) {
digitsEntered = state.GetInt (DigitsEnteredKey, digitsEntered);
newDuration = new Duration (
state.GetInt (NewDurationHoursKey, newDuration.Hours),
state.GetInt (NewDurationMinutesKey, newDuration.Minutes));
}
LoadData ();
}
示例5: OnCreate
protected override void OnCreate(Bundle savedInstanceState) {
base.OnCreate(savedInstanceState);
SetContentView(R.Layout.fragment_stack);
// Watch for button clicks.
Button button = (Button)FindViewById(R.Id.new_fragment);
button.Click += (s, x) => AddFragmentToStack();
button = (Button)FindViewById(R.Id.home);
button.Click += (s, x) =>
{
// If there is a back stack, pop it all.
FragmentManager fm = GetSupportFragmentManager();
if (fm.GetBackStackEntryCount() > 0)
{
fm.PopBackStack(fm.GetBackStackEntryAt(0).GetId(),
Android.Support.V4.App.FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
};
if (savedInstanceState == null) {
// Do first time initialization -- Add initial fragment.
Fragment newFragment = CountingFragment.NewInstance(mStackLevel);
FragmentTransaction ft = GetSupportFragmentManager().BeginTransaction();
ft.Add(R.Id.simple_fragment, newFragment).Commit();
} else {
mStackLevel = savedInstanceState.GetInt("level");
}
}
示例6: logResponseCode
protected void logResponseCode(String method, Bundle response)
{
var responseCode = (Consts.ResponseCode)(response.GetInt(Consts.BILLING_RESPONSE_RESPONSE_CODE));
if (Consts.DEBUG)
Log.Error("BillingService", method + " received " + responseCode.ToString());
}
示例7: OnRestoreInstanceState
protected override void OnRestoreInstanceState(Bundle outState)
{
photo_index = outState.GetInt ("photo_index");
ShowPhoto (photo_index);
base.OnRestoreInstanceState (outState);
}
示例8: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
button = FindViewById<Button> (Resource.Id.myButton);
button.Click += delegate {
Log.Error(TAG, "First delegate!");
count++;
UpdateCountsView ();
};
button.Click += (sender, e) => {
Log.Error(TAG, "Second delegate!");
};
// button.SetOnClickListener (this);
if (bundle != null) {
count = bundle.GetInt (EXTRA_COUNT, 0);
UpdateCountsView ();
}
}
示例9: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
if (bundle != null)
{
current_theme = bundle.GetInt("theme");
switch (current_theme)
{
case Resource.Style.ThemeCurrent:
current_theme = Resource.Style.ThemeCurrentDialog;
break;
case Resource.Style.ThemeCurrentDialog:
current_theme = Resource.Style.ThemeCurrentDialogWhenLarge;
break;
case Resource.Style.ThemeCurrentDialogWhenLarge:
current_theme = Resource.Style.Theme;
break;
default:
current_theme = Resource.Style.ThemeCurrent;
break;
}
SetTheme(current_theme);
}
SetContentView(Resource.Layout.activity_recreate);
// Watch for button clicks
var button = FindViewById<Button>(Resource.Id.recreate);
button.Click += delegate { Recreate(); };
}
示例10: OnCreate
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
if (savedInstanceState != null) {
drawable_res_id = savedInstanceState.GetInt("drawable_res_id", 0);
}
}
示例11: OnActivityCreated
public override void OnActivityCreated(Bundle savedInstanceState)
{
base.OnActivityCreated(savedInstanceState);
var detailsFrame = Activity.FindViewById<View>(Resource.Id.details);
// If running on a tablet, then the layout in Resources/Layout-Large will be loaded.
// That layout uses fragments, and defines the detailsFrame. We use the visiblity of
// detailsFrame as this distinguisher between tablet and phone.
_isDualPane = detailsFrame != null && detailsFrame.Visibility == ViewStates.Visible;
var adapter = new ArrayAdapter<String>(Activity, Android.Resource.Layout.SimpleListItemChecked, Shakespeare.Titles);
ListAdapter = adapter;
if (savedInstanceState != null)
{
_currentPlayId = savedInstanceState.GetInt("current_play_id", 0);
}
if (_isDualPane)
{
ListView.ChoiceMode = ChoiceMode.Single;
ShowDetails(_currentPlayId);
}
}
示例12: OnCreateView
//@Override
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
if (mPos == -1 && savedInstanceState != null)
mPos = savedInstanceState.GetInt("mPos");
TypedArray imgs = Resources.ObtainTypedArray(Resource.Array.birds_img);
mImgRes = imgs.GetResourceId(mPos, -1);
GridView gv = (GridView)inflater.Inflate(Resource.Layout.list_grid, null);
gv.SetBackgroundResource(Android.Resource.Color.Black);
gv.Adapter=new GridAdapter(this);
//gv.setOnItemClickListener(new OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position,
// long id) {
// if (getActivity() == null)
// return;
// ResponsiveUIActivity activity = (ResponsiveUIActivity) getActivity();
// activity.onBirdPressed(mPos);
// }
//});
gv.ItemClick += delegate {
if (this.Activity == null)
return;
ResponsiveUIActivity activity = (ResponsiveUIActivity)this.Activity;
activity.onBirdPressed(mPos);
};
return gv;
}
示例13: OnCreate
public override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
if (null != savedInstanceState) {
scrollPosition = savedInstanceState.GetInt ("scroll_position");
}
}
示例14: OnActivityCreated
public override void OnActivityCreated(Bundle savedInstanceState)
{
base.OnActivityCreated(savedInstanceState);
Setts sett = Common.GetSettings ();
DateTimeFormatInfo dfi = DateTimeFormatInfo.CurrentInfo;
Calendar cal = dfi.Calendar;
int week = (cal.GetWeekOfYear (DateTime.Today, dfi.CalendarWeekRule, dfi.FirstDayOfWeek) - sett.weekOfStart)%3;
var choosenHospitals = HospitalManager.GetChoosenHospitals(week, DateTime.Today.DayOfWeek);
var doctors = DoctorManager.GetDoctors ();
docs = new List<string> ();
chdocs = new List<Doctor> ();
for (int d = 0; d < doctors.Count; d++) {
for (int h = 0; h < choosenHospitals.Count; h++) {
if (doctors [d].HospitalID == choosenHospitals [h].ID) {
chdocs.Add (doctors [d]);
docs.Add(doctors [d].FirstName + ' ' + doctors [d].SecondName + ' ' + doctors [d].ThirdName);
}
}
}
var detailsFrame = Activity.FindViewById<View>(Resource.Id.details);
_isDualPane = detailsFrame != null && detailsFrame.Visibility == ViewStates.Visible;
var adapter = new ArrayAdapter<String>(Activity, Android.Resource.Layout.SimpleListItemChecked, docs/*Shakespeare.Titles*/);
ListAdapter = adapter;
//progress.Dismiss();
if (savedInstanceState != null)
{
_currentPlayId = savedInstanceState.GetInt("current_play_id", chdocs[0].ID);
}
if (_isDualPane)
{
ListView.ChoiceMode = ChoiceMode.Single;
ShowDetails(chdocs[_currentPlayId].ID);
}
/////////////////////////////////////////////////////////////////////////////////
if (presents == null) {
var progress = ProgressDialog.Show (Activity, "Loading prsentations", "Please Wait (about 15 seconds)", true);
new Thread (new ThreadStart (() => {
Thread.Sleep (15 * 1000);
Activity.RunOnUiThread (() => {
presents = Presentations.GetPresentations ();
progress.Dismiss ();
});
})).Start ();
}
/////////////////////////////////////////////////////////////////////////////////
}
示例15: OnCreate
/// <inheritdoc />
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
if (savedInstanceState != null)
{
currentSelectedPosition = savedInstanceState.GetInt(StateSelectedPosition);
}
}