/// <summary> /// Ons the create. /// </summary> /// <param name="savedInstanceState">Saved instance state.</param> protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); if (ValidationUtils.GetNetworkStatus()) { await descargaInfoAsync(); } else { ToolsUtilsAndroid.alertDialogApplicationMessage(this , Constante.ALERT_TITLE , Constante.ALERT_MESSAGE_NOTCONNECTION_INTERNET , Constante.ALERT_POSITIVE_BUTTON , "", Resource.Mipmap.ic_logo_round); } }
/// <summary> /// Perfilars the async. /// </summary> /// <returns>The async.</returns> async Task descargaInfoAsync() { myFirebaseIIDService = new MyFirebaseIIDService(); myFirebaseIIDService.OnTokenRefresh(); var horoscopoDelDia = await ServiceDelegate.Instance.GetHoroscopo(); if (horoscopoDelDia.Success) { DataManager.Horoscopos = horoscopoDelDia.Response as HoroscopoActual; Intent i = new Intent(this, typeof(HomeActivity)); StartActivity(i); } else { ToolsUtilsAndroid.alertDialogApplicationMessage(this , Constante.ALERT_TITLE , Constante.ALERT_MESSAGE_ERROR_INESPERADO , Constante.ALERT_POSITIVE_BUTTON , "", Resource.Mipmap.ic_logo_round); } }