首页 > 移动平台 > 详细

vs xamarin android 读取

时间:2015-06-11 18:41:56      阅读:255      评论:0      收藏:0      [点我收藏+]
private void Btn_Click(object sender, EventArgs e)
{
    var u = FindViewById<EditText>(Resource.Id.editText1).Text;
    var p = FindViewById<EditText>(Resource.Id.editText2).Text;
    var progressDialog = ProgressDialog.Show(this, "Please wait...", "Checking account info...", true);
    var t=new Thread(new ThreadStart(delegate
    {
        var r = Api.CheckUser(u, p);
        if (r.HasValue)
        {
            RunOnUiThread(() => progressDialog.Hide());
            AppConfig.Config.SetNowUserId(r.Value);
            StartActivity(typeof(MainActivity));
            Finish();
        }
        else
        {
            RunOnUiThread(() => Toast.MakeText(this, "用户名或密码错误", ToastLength.Long).Show());
            RunOnUiThread(() => progressDialog.Hide());
        }
                
    }));
    t.Start();
}

把loading框显示出来,然后开新线程做事,之后关闭loading框

vs xamarin android 读取

原文:http://www.cnblogs.com/czcz1024/p/4569764.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!