本文整理汇总了C#中Android.App.ProgressDialog.Show方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.Show方法的具体用法?C# ProgressDialog.Show怎么用?C# ProgressDialog.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowStatus
public static ProgressDialog ShowStatus(Context cxt, string msg)
{
ProgressDialog status = new ProgressDialog(cxt);
status.SetMessage(msg);
status.Show();
return status;
}
示例2: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
var groupName = Intent.GetStringExtra("name");
Title = groupName;
GroupName = groupName;
_contactRepo = new ContactRepository(this);
_progressDialog = new ProgressDialog(this);
_progressDialog.SetMessage("Loading Contacts. Please wait...");
_progressDialog.Show();
Task.Factory
.StartNew(() =>
_contactRepo.GetAllMobile())
.ContinueWith(task =>
RunOnUiThread(() =>
{
if (task.Result != null)
DisplayContacts(task.Result);
_progressDialog.Dismiss ();
}));
}
示例3: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
// Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);
mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);
photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);
photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);
ProgressDialog pg = new ProgressDialog(Activity);
pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
pg.SetCancelable(false);
pg.Show();
Task.Run(async () => {
Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
Activity.RunOnUiThread(() => {
mImageView.SetImageBitmap(image);
//Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
pg.Dismiss();
});
});
return v;
}
示例4: OnCreateView
public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View view = inflater.Inflate(Resource.Layout.SignLayout, container, false);
Button clearButton = view.FindViewById<Button> (Resource.Id.clearButton);
Button sendButton = view.FindViewById<Button> (Resource.Id.sendButton);
EditText remarks = view.FindViewById<EditText> (Resource.Id.txtRemarks);
ToggleButton notification = view.FindViewById<ToggleButton> (Resource.Id.toggleNotifications);
SignView signView = view.FindViewById<SignView> (Resource.Id.signView);
mDialog = new ProgressDialog(this.Activity);
mDialog.SetMessage("Sending...");
mDialog.SetCancelable(false);
clearButton.Click += delegate {
signView.ClearCanvas();
};
sendButton.Click += delegate {
using (MemoryStream stream = new MemoryStream())
{
if (signView.CanvasBitmap().Compress(Bitmap.CompressFormat.Png, 100, stream))
{
byte[] image = stream.ToArray();
string base64signature = Convert.ToBase64String(image);
Backend.Current.send(base64signature, remarks.Text, notification.Activated, OnSendSuccess, OnSendFail);
mDialog.Show();
}
}
};
return view;
}
示例5: OnCreate
protected async override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// shows a spinner while it gets polls from database
var progressDialog = new ProgressDialog(this);
progressDialog.Show();
{
try
{
// gets all the polls from the database
polls = await VotingService.MobileService.GetTable<Poll>().ToListAsync();
}
catch (Exception exc)
{
// error dialog that shows if something goes wrong
var errorDialog = new AlertDialog.Builder(this).SetTitle("Oops!").SetMessage("Something went wrong " + exc.ToString()).SetPositiveButton("Okay", (sender1, e1) =>
{
}).Create();
errorDialog.Show();
}
};
// ends spinner on completion
progressDialog.Dismiss();
// created table for polls
ListAdapter = new ArrayAdapter<Poll>(this, Android.Resource.Layout.SimpleListItem1, polls);
}
示例6: OnViewModelSet
protected override void OnViewModelSet()
{
base.OnViewModelSet();
// show a progress box if there is some work
var events = ViewModel as EventsViewModel;
if (events != null)
{
ProgressDialog progress = null;
events.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == "IsWorking")
{
if (events.IsWorking)
{
if (progress == null)
{
progress = new ProgressDialog(this);
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.SetMessage("Doing absolutely nothing in the background...");
progress.Show();
}
}
else
{
if (progress != null)
{
progress.Dismiss();
progress = null;
}
}
}
};
}
}
示例7: ConnectToRelay
private async Task ConnectToRelay()
{
bool connected = false;
var waitIndicator = new ProgressDialog(this) { Indeterminate = true };
waitIndicator.SetCancelable(false);
waitIndicator.SetMessage("Connecting...");
waitIndicator.Show();
try
{
var prefs = PreferenceManager.GetDefaultSharedPreferences(this);
connected = await _remote.Connect(prefs.GetString("RelayServerUrl", ""),
prefs.GetString("RemoteGroup", ""),
prefs.GetString("HubName", ""));
}
catch (Exception)
{
}
finally
{
waitIndicator.Hide();
}
Toast.MakeText(this, connected ? "Connected!" : "Unable to connect", ToastLength.Short).Show();
}
示例8: SaveButton_Click
private async void SaveButton_Click(object sender, EventArgs ea)
{
var dialog = new ProgressDialog(this);
dialog.SetMessage(Resources.GetString(Resource.String.Saving));
dialog.SetCancelable(false);
dialog.Show();
try
{
Bindings.UpdateSourceForLastView();
this.Model.ApplyEdit();
var returnModel = await this.Model.SaveAsync();
InitializeBindings(returnModel);
}
catch (Exception ex)
{
var alert = new AlertDialog.Builder(this);
alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
alert.Show();
}
finally
{
dialog.Hide();
}
}
示例9: OnClick
public void OnClick(View V)
{
ProgressDialog progress = new ProgressDialog(this);
try
{
switch(V.Id)
{
case Resource.Id.bSignIn :
{
isLogin=false;
Boolean blnValidate= FieldValidation();
if (blnValidate==true)
{
progress.Indeterminate = true;
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.SetMessage("Contacting server. Please wait...");
progress.SetCancelable(true);
progress.Show();
var progressDialog = ProgressDialog.Show(this, "Please wait...", "Checking Login info...", true);
new Thread(new ThreadStart(delegate
{
RunOnUiThread(() => ValidateSqluserpwd(etUsername.Text.ToString() , etpwd.Text.ToString()));
if (isLogin== true){
RunOnUiThread(() => Toast.MakeText(this, "Login detail found in system...", ToastLength.Short).Show());
}
RunOnUiThread(() => progressDialog.Hide());
})).Start();
}
break;
}
case Resource.Id.tvforget :
{
var toast = Toast.MakeText(this,"Forget link clicked",ToastLength.Short);
toast.Show();
break;
}
case Resource.Id.tvregister :
{
var myIntent = new Intent (this, typeof(MainActivity));
StartActivityForResult (myIntent, 0);
break;
}
}
}
catch (NullReferenceException ex) {
var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
toast.Show ();
}
finally
{
// Now hide the progress dialog
progress.Dismiss();
}
}
示例10: Show
public void Show(Context context, string content)
{
var dialog = new ProgressDialog(context);
dialog.SetMessage(content);
dialog.SetCancelable(false);
dialog.Show();
System.Threading.Thread.Sleep (2000);
dialog.Hide ();
}
示例11: MakeCall
public static void MakeCall(CallEntity callEntity, Activity activity)
{
var category = callEntity.Category;
var choice = callEntity.Choice ?? "";
var detail = callEntity.Detail ?? "";
new AlertDialog.Builder(activity)
.SetTitle(category + " " + choice + " " + detail)
.SetMessage(Strings.CallSendMessage)
.SetPositiveButton(Strings.CallSend, delegate
{
ThreadPool.QueueUserWorkItem(o =>
{
activity.RunOnUiThread(() =>
{
dialog = new ProgressDialog(activity);
dialog.SetMessage(Strings.SpinnerDataSending);
dialog.SetCancelable(false);
dialog.Show();
});
try
{
ICall patientCall = new PatientCall();
// Assign the callid with the returned MongoDB id
callEntity._id = patientCall.MakeCall(callEntity);
activity.RunOnUiThread(() =>
{
// Call successfull, take the user to myCalls
activity.ActionBar.SelectTab(activity.ActionBar.GetTabAt(1));
SetNewCalls(callEntity);
dialog.Hide();
});
}
catch (Exception ex)
{
Console.WriteLine("ERROR making call: " + ex.Message);
activity.RunOnUiThread(() =>
{
dialog.Hide();
new AlertDialog.Builder(activity).SetTitle(Strings.Error)
.SetMessage(Strings.ErrorSendingCall)
.SetPositiveButton(Strings.OK,
delegate { }).Show();
});
}
});
})
.SetNegativeButton(Strings.Cancel, delegate {/* Do nothing */ })
.Show();
}
示例12: showProgressRootView
public void showProgressRootView(Activity _activity){
if (progressDialogParentRootView != null) {
progressDialogParentRootView.Hide ();
progressDialogParentRootView = null;
}
progressDialogParentRootView = ProgressDialog.Show (_activity, "", "", true);
progressDialogParentRootView.SetContentView(new ProgressBar(_activity));
progressDialogParentRootView.SetCancelable (true);
progressDialogParentRootView.Show ();
}
示例13: OnPreExecute
protected override void OnPreExecute()
{
base.OnPreExecute();
progDialog = new ProgressDialog(activity);
progDialog.SetMessage("Logging Out...");
progDialog.Indeterminate=false;
progDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
progDialog.SetCancelable(true);
progDialog.Show();
}
示例14: ShowLoadingDialog
public static ProgressDialog ShowLoadingDialog(Context context)
{
var loadingDialog = new ProgressDialog(context);
loadingDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
loadingDialog.Show();
return loadingDialog;
// Alt
//ProgressDialog.Show(this, "Retrieving Nearby Places", "Please wait...", true);
}
示例15: Start
private void Start(ProgressDialog pd)
{
try
{
pd.Show();
}
catch (System.Exception ex)
{
Log.Debug("TEST", ex.Message);
}
}