本文整理汇总了C#中Android.App.ProgressDialog.SetMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.SetMessage方法的具体用法?C# ProgressDialog.SetMessage怎么用?C# ProgressDialog.SetMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.SetMessage方法的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: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button start = FindViewById<Button>(Resource.Id.startButton);
Button stop = FindViewById<Button>(Resource.Id.stopButton);
ProgressDialog pd = new ProgressDialog(this)
{
Indeterminate = true,
};
pd.SetMessage("Waiting");
pd.SetButton("cancel", (s, e) => Stop(pd));
pd.SetIcon(Resource.Drawable.Icon);
//pd.SetCancelable(false);
Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
pd.SetIndeterminateDrawable(myIcon);
start.Click += delegate { Start(pd); };
stop.Click += delegate { Stop(pd); };
}
示例4: 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;
}
}
}
};
}
}
示例5: 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;
}
示例6: 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;
}
示例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: CreateProgressDialog
public static ProgressDialog CreateProgressDialog(string message, Activity activity)
{
var mProgressDialog = new ProgressDialog(activity, Resource.Style.LightDialog);
mProgressDialog.SetMessage(message);
mProgressDialog.SetCancelable(false);
mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
return mProgressDialog;
}
示例10: 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();
}
}
示例11: 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 ();
}
示例12: 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();
}
示例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: ShowProgressDialog
public static ProgressDialog ShowProgressDialog(Activity activity, int messageResId, /*int titleResId,*/ bool allowCancel, ProgressDialogStyle style=ProgressDialogStyle.Spinner)
{
ProgressDialog dialog = new ProgressDialog(activity);
dialog.SetProgressStyle(style);
//dialog.SetTitle(titleResId);
dialog.SetMessage(activity.Resources.GetString(messageResId));
dialog.SetCancelable(allowCancel);
dialog.SetCanceledOnTouchOutside(allowCancel);
dialog.Show();
return dialog;
}
示例15: CreateProgressDialog
private ProgressDialog CreateProgressDialog()
{
var progress = new ProgressDialog(this)
{
Indeterminate = true
};
progress.SetCancelable(false);
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.SetMessage("Contacting server. Please wait...");
return progress;
}