I have an overlay activity that starts before my app executes long running operations and closes it after ending that operation. The operation works fine, but the overlay activity doesn't show up.
btnVerify.Enabled = false;
Intent i = new Intent(this, typeof(Overlay));
i.AddFlags(ActivityFlags.NewTask);
StartActivity(i);
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
RunOnUiThread(delegate
{
{
object Token = RSMobile.Class.BLL.Member.MemberData.GetActivationKey(PhoneNumber);
if (Token != null && !string.IsNullOrEmpty(Token.ToString()))
{
RSProperties.Token = Token.ToString();
//ActivationKey sent to phonenumber,waiting for enter that
Intent myIntent = new Intent();
myIntent.PutExtra("PhoneNumber", PhoneNumber);
myIntent.PutExtra("IdLanguage", spLanguage.SelectedItemPosition);
myIntent.SetClass(this, typeof(CheckActivationKey));
myIntent.AddFlags(ActivityFlags.NewTask);
StartActivity(myIntent);
//Finish();
}
else
{
myToast.MakeText(this, "خطا در احراز هویت", ToastLength.Long);
}
btnVerify.Enabled = true;
Overlay.CurrentActivity.Finish();
}
});
})).Start();