private void InviteDevices(object sender, EventArgs e) { #pragma warning disable 0618 var progress = new Android.App.ProgressDialog(Context); progress.SetCancelable(false); progress.SetMessage(GetString(Resource.String.sending_invites)); progress.Show(); #pragma warning restore 0618 Task.Run(async() => { try { var inviteCode = Globals.CloudManager.SharePersonalCloud(Globals.CloudManager.PersonalClouds[0]); Activity?.RunOnUiThread(() => { progress.Dismiss(); var dialog = new AndroidX.AppCompat.App.AlertDialog.Builder(Context, Resource.Style.AlertDialogTheme) .SetIcon(Resource.Mipmap.ic_launcher_round).SetCancelable(false) .SetTitle(Resource.String.invited_title) .SetMessage(GetString(Resource.String.invited_message, inviteCode)) .SetPositiveButton(Resource.String.void_invites, (o, e) => { try { Globals.CloudManager.StopSharePersonalCloud(Globals.CloudManager.PersonalClouds[0]); } catch { } }).Show(); }); } catch { Activity.RunOnUiThread(() => { progress.Dismiss(); Activity.ShowAlert(GetString(Resource.String.error_invite), GetString(Resource.String.cannot_send_invites)); }); } }); }
public async Task getData() { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); dynamic value = new ExpandoObject(); value.DesignationId = desig_Id; string json = JsonConvert.SerializeObject(value); try { JsonValue item = await restService.FrequentList(Activity, json, geolocation).ConfigureAwait(false); freq = JsonConvert.DeserializeObject <List <FrequentList> >(item); db.InsertFrequentList(freq); if (freq.Count > 0) { adapter = new FrequentAdapter(Activity, freq); } gv.Adapter = adapter; progress.Dismiss(); } catch (Exception ex) { progress.Dismiss(); } progress.Dismiss(); }
public void OnFailure(Java.Lang.Exception e) { progressDialog.Dismiss(); this.ShowMessage(Resource.String.change_avatar_failure); Dismiss(); }
private async void getVideo() { progress.Show(); try { VideoAPI_Response response = await videoapi.GetVideoList(); videoList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < videoList.Count; i++) { Video_List.Add(videoList[i].videoId); Video_List.Add(videoList[i].title); Video_List.Add(videoList[i].thumb); Video_List.Add(videoList[i].videoURL); Vid_Id = videoList[i].videoId; Vid_title = videoList[i].title; Vid_thum = videoList[i].thumb; Vid_url = videoList[i].videoURL; Video_dba.insertVideoData(Vid_Id, Vid_title, Vid_thum, Vid_url); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalVideo", "true"); edit.Apply(); Videos_GridView_Adapter videos_detail = new Videos_GridView_Adapter(Activity, videoList); MyList_Videos.Adapter = videos_detail; // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, Video_List); progress.Dismiss(); //MyList_Videos.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => //{ // Intent taskIntentActivity5 = new Intent(this.Activity, typeof(YouTube_Activity)); // StartActivity(taskIntentActivity5); //}; } catch (Exception e) { progress.Dismiss(); } }
private async void getAffairsList() { progress.Show(); try { CurrentAffairsAPI_Response response = await currentaffairapi.GetCurrentAffairsList(); affairsList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < affairsList.Count; i++) { CurrentsAffairs_List.Add(affairsList[i].content_id); CurrentsAffairs_List.Add(affairsList[i].content_title); CurrentsAffairs_List.Add(affairsList[i].content_date); CurrentsAffairs_List.Add(affairsList[i].content_file); Curr_Id = affairsList[i].content_id; Curr_Title = affairsList[i].content_title; Curr_Date = affairsList[i].content_date; Curr_File = affairsList[i].content_file; dba.insertCurrentAffairData(Curr_Id, Curr_Title, Curr_Date, Curr_File); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalAffairs", "true"); edit.Apply(); CurrentAffairAdapter W_Adapter = new CurrentAffairAdapter(Activity, affairsList, MyListCurrentAffairs); mLayoutManager = new LinearLayoutManager(this.Activity); MyListCurrentAffairs.SetLayoutManager(mLayoutManager); CurrentAffairAdapter mAdapter = new CurrentAffairAdapter(Activity, affairsList, MyListCurrentAffairs); mAdapter.ItemClick += MAdapter_ItemClick; MyListCurrentAffairs.SetAdapter(mAdapter); progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getNotice() { progress.Show(); try { string datetime = DateTime.Now.ToString("yyyy-MM-dd"); NoticeBoadrAPI_Response response = await noticeapi.GetNoticeBoardList(datetime); noticeList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < noticeList.Count; i++) { Notice_List.Add(noticeList[i].content_id); Notice_List.Add(noticeList[i].content_title); Notice_List.Add(noticeList[i].content_text); Notice_List.Add(noticeList[i].content_date); Not_Id = noticeList[i].content_id; Not_Title = noticeList[i].content_title; Not_text = noticeList[i].content_text; Not_date = noticeList[i].content_date; Notice_dba.insertNoticeBoardlData(Not_Id, Not_Title, Not_text, Not_date); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalNotice", "true"); edit.Apply(); mLayoutManager = new LinearLayoutManager(this.Activity); MyListNotice.SetLayoutManager(mLayoutManager); Notice_ListView_Adapter videos_detail = new Notice_ListView_Adapter(Activity, noticeList, MyListNotice); MyListNotice.SetAdapter(videos_detail); videos_detail.ItemClick += Videos_detail_ItemClick; progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getStudyMaterial() { progress.Show(); try { StudyMaterialAPI_Response response = await studymaterial_api.GetStudyMaterialList(); SM_List = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < SM_List.Count; i++) { StudyMaterial_List.Add(SM_List[i].content_id); StudyMaterial_List.Add(SM_List[i].content_title); StudyMaterial_List.Add(SM_List[i].click_url); StudyMaterial_List.Add(SM_List[i].ordering); SM_Id = SM_List[i].content_id; SM__Title = SM_List[i].content_title; SM_url = SM_List[i].click_url; SM_ordering = SM_List[i].ordering; StudyMaterial_dba.insertStudyMaterialData(SM_Id, SM__Title, SM_url, SM_ordering); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalStudyMaterial", "true"); edit.Apply(); StudyMaterial_ListView_Adapter Study_detail = new StudyMaterial_ListView_Adapter(Activity, SM_List); MyList_StudyMaterial.Adapter = Study_detail; progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void Invite_Friends() { progress.Show(); try { mWebView.LoadUrl(LoadURL); progress.Dismiss(); if (inviteFriends.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("InviteFriends", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("invitefriend", inviteFriends); edit.Apply(); } Intent intent = new Intent(Activity, typeof(ContactUsFragment)); Activity.StartActivity(intent); } catch (Exception e) { } }
private async void getAdmissionData() { progress.Show(); try { AdmissionModel response = await admissionapi.GetCareerList(); List <ResDataAdmission> resddat = response.res_data; Admission = resddat[0].content_text + resddat[0].content_title; //finalAdmission = new List<AdmissionModel>(); //for (int i = 0; i < resddat.Count; i++) //{ // Admission_List.Add(resddat[i].content_id); // Admission_List.Add(resddat[i].content_text); // Admission_List.Add(resddat[i].content_title); // Admission_List.Add(resddat[i].content_date); //} mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientAdmission()); mWebView.LoadData("<html>" + Admission + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (Admission.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("AdmissionInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("Admissioncontent", Admission); edit.Apply(); } Intent intent = new Intent(Activity, typeof(Admission_Fragment)); Activity.StartActivity(intent); } catch (Exception e) { } }
private async void getFAQ() { progress.Show(); try { FAQ_ResData response = await faq_api.GetFAQList(); faq_List = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < faq_List.Count; i++) { FAQ_List.Add(faq_List[i].content_id); FAQ_List.Add(faq_List[i].content_title); FAQ_List.Add(faq_List[i].content_text); FAQ_List.Add(faq_List[i].content_date); FAQ_Id = faq_List[i].content_id; FAQ_Title = faq_List[i].content_title; FAQ_text = faq_List[i].content_text; FAQ_date = faq_List[i].content_date; FAQ_dba.insertFAQData(FAQ_Id, FAQ_Title, FAQ_text, FAQ_date); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalFAQ", "true"); edit.Apply(); FAQ_ListView_Adapter faq_detail = new FAQ_ListView_Adapter(Activity, faq_List); MyList_FAQ.Adapter = faq_detail; progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getVocabularyList() { progress.Show(); try { VocabularyAPI_Response response = await vocabularyapi.GetVocabularyList(); vocabularyList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < vocabularyList.Count; i++) { Vocabulary_List.Add(vocabularyList[i].content_id); Vocabulary_List.Add(vocabularyList[i].content_title); Vocabulary_List.Add(vocabularyList[i].content_date); Vocabulary_List.Add(vocabularyList[i].content_file); Voc_Id = vocabularyList[i].content_id; Voc_Title = vocabularyList[i].content_title; Voc_Date = vocabularyList[i].content_date; Voc_File = vocabularyList[i].content_file; dba.insertVocabularyData(Voc_Id, Voc_Title, Voc_Date, Voc_File); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalVocabulary", "true"); edit.Apply(); mLayoutManager = new LinearLayoutManager(this.Activity); MyListWeeklyVocabulary.SetLayoutManager(mLayoutManager); VocabularyAdapter mAdapter = new VocabularyAdapter(Activity, vocabularyList, MyListWeeklyVocabulary); mAdapter.ItemClick += MAdapter_ItemClick; MyListWeeklyVocabulary.SetAdapter(mAdapter); progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getAlertList() { progress.Show(); try { ExamAlertAPI_Response response = await examalertapi.GetExamAlertList(); alertList = response.res_data; for (int i = 0; i < alertList.Count; i++) { ExamAlert_List.Add(alertList[i].content_id); ExamAlert_List.Add(alertList[i].content_title); ExamAlert_List.Add(alertList[i].content_date); ExamAlert_List.Add(alertList[i].content_file); alert_Id = alertList[i].content_id; alert_Title = alertList[i].content_title; alert_Date = alertList[i].content_date; alert_File = alertList[i].content_file; dba.insertExamAlertData(alert_Id, alert_Title, alert_Date, alert_File); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalAlert", "true"); edit.Apply(); ExamAlertAdapter W_Adapter = new ExamAlertAdapter(Activity, alertList, MyListExamAlert); mLayoutManager = new LinearLayoutManager(this.Activity); MyListExamAlert.SetLayoutManager(mLayoutManager); ExamAlertAdapter mAdapter = new ExamAlertAdapter(Activity, alertList, MyListExamAlert); mAdapter.ItemClick += MAdapter_ItemClick; MyListExamAlert.SetAdapter(mAdapter); progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getGallery() { progress.Show(); try { GalleryAPI_Response response = await galleryapi.GetGalleryList(); galleryList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < galleryList.Count; i++) { Gallery_List.Add(galleryList[i].gallery_id); Gallery_List.Add(galleryList[i].gallery_name); Gallery_List.Add(galleryList[i].gallery_url); Gallr_Id = galleryList[i].gallery_id; Gallr_Name = galleryList[i].gallery_name; Gallr_url = galleryList[i].gallery_url; Gallerydba.insertGalleryData("", Gallr_Name, Gallr_url); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalGallery", "true"); edit.Apply(); // MyListGallery.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, Gallery_List); Gallery_Grid_Adapter gallerydetail = new Gallery_Grid_Adapter(Activity, galleryList); List_View.Adapter = gallerydetail; progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private void HideProgressDialog() { Activity.RunOnUiThread(() => { progress.Hide(); progress.Dismiss(); }); }
public void OnCallback(T result) { try { pd.Dismiss(); } catch (Exception e) { Debug.E("Error", e); } }
private async void getBookMarkList() { progress.Show(); try { BookMarkAPI_Response response = await bookmarkapi.GetBookMarkList(); bookmarkList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < bookmarkList.Count; i++) { BookMark_List.Add(bookmarkList[i].content_id); BookMark_List.Add(bookmarkList[i].content_title); BookMark_List.Add(bookmarkList[i].content_date); BookMark_List.Add(bookmarkList[i].content_file); Book_Id = bookmarkList[i].content_id; Book_Title = bookmarkList[i].content_title; Book_Date = bookmarkList[i].content_date; Book_File = bookmarkList[i].content_file; dba.insertBookMarkData(Book_Id, Book_Title, Book_Date, Book_File); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalBookMark", "true"); edit.Apply(); MyListBookMark.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleSpinnerItem, BookMark_List); progress.Dismiss(); } catch (Exception e) { progress.Dismiss(); } }
private async void getFacilities() { progress.Show(); try { FacilitiesModel response = await facilitiesapi.GetFacilitiesList(); ResDataFacilities resfaci = response.res_data; Faci_content = resfaci.content; mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientFacilities()); mWebView.LoadData("<html>" + Faci_content + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (facility.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("FacilitiesInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("facilitycontent", Faci_content); edit.Apply(); } // Intent intent = new Intent(Activity, typeof(Facilities_Fragment)); // Activity.StartActivity(intent); } catch (Exception e) { progress.Dismiss(); Toast.MakeText(Activity, "" + e.Message, ToastLength.Short).Show(); } }
public async Task Send_Number() { if (ic.connectivity()) { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); OTPModel otp_data = new OTPModel(); otp_data.MobileNo = number; otp_data.SMS = "OTP"; string otp_json = JsonConvert.SerializeObject(otp_data); try { string item = await restService.GetOtp(Activity, licenceid, geolocation, version, otp_json); if (item.Contains("Authentication Failed")) { progress.Dismiss(); AlertBox(); } else { var primeArray = item.Split(','); otp = primeArray[0]; otp = otp.Substring(1); username = primeArray[1]; progress.Dismiss(); verification(); } } catch (Exception e) { progress.Dismiss(); } } else { progress.Dismiss(); } }
protected override void OnDetachingFrom(Page bindable) { base.OnDetachingFrom(bindable); #if __ANDROID__ renderObj.Dismiss(); #elif __IOS__ #elif __UWP__ bindable.IsBusy = false; #endif }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.MyDownload_Layout, container, false); MyListDownload = v.FindViewById <ListView>(Resource.Id.listViewdownload); //==================================Fetch api==========================// JsonConvert.DefaultSettings = () => new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), Converters = { new StringEnumConverter() } }; // String apiurl = string.Format("http://mg.mahendras.org); downloadapi = RestService.For <Download_API>("http://mg.mahendras.org"); // getDownLoadList(); //=====================================================================// if (DownLoad_Data.Equals("false")) { getDownLoadList(); } else { //getAboutExam(); downloadList = Download_dba.Get_DownloadData(); for (int i = 0; i < downloadList.Count; i++) { Download_List.Add(downloadList[i].content_title); } MyListDownload.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleSpinnerItem, Download_List); progress.Dismiss(); } return(v); }
public async Task getorglist(string org_id) { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); dynamic value = new ExpandoObject(); value.OrgId = org_id; string json = JsonConvert.SerializeObject(value); try { string item = await restservice.MarkingList(Activity, json, location).ConfigureAwait(false); markinglist = JsonConvert.DeserializeObject <List <MarkingListModel> >(item); db.InsertMarkingList(markinglist); progress.Dismiss(); } catch (Exception ex) { progress.Dismiss(); } if (markinglist != null) { Activity.RunOnUiThread(() => { marked = new MarkingListAdapter(Activity, markinglist); list.SetAdapter(marked); }); } progress.Dismiss(); }
private async void BtnRegistrar_Click(object sender, EventArgs e) { progress = new Android.App.ProgressDialog(this.Context); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetMessage("Registrando...Espere..."); progress.SetCancelable(false); progress.Show(); string dni = txtdni.Text; string nombre = txtnombre.Text; string email = txtEmail.Text; string telef = txtTele_F.Text; string telec = txtTele_C.Text; if (!string.IsNullOrEmpty(dni) || !string.IsNullOrEmpty(nombre) || !string.IsNullOrEmpty(email) || !string.IsNullOrEmpty(telef) || !string.IsNullOrEmpty(telec)) { //await var dato = await controller.RegistraCliente(int.Parse(dni), nombre, email, int.Parse(telef), int.Parse(telec)); if (dato != null) { progress.Dismiss(); Toast.MakeText(this.Context, "Registrado Correctamente", ToastLength.Short).Show(); LimpiarCasillas(); } else { progress.Dismiss(); Toast.MakeText(this.Context, "Error al Registrar", ToastLength.Short).Show(); LimpiarCasillas(); } } else { progress.Dismiss(); Toast.MakeText(this.Context, "Campos vacios", ToastLength.Short).Show(); } }
private async void getBranch() { progress.Show(); try { BranchAPI_Response response = await branchapi.GetBranchList(); branchList = response.res_data; // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); for (int i = 0; i < branchList.Count; i++) { Branch_List.Add(branchList[i].state_name); } MyListBranch.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleDropDownItem1Line, Branch_List); progress.Dismiss(); //if (mybranch.Length <= 0) //{ // ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("MyBranchInfo", FileCreationMode.Private); // ISharedPreferencesEditor edit = pref.Edit(); // edit.PutString("MyBranch", Branch_List.ToString()); // edit.Apply(); //} //Intent intent = new Intent(Activity, typeof(BranchFragment)); //Activity.StartActivity(intent); } catch (Exception e) { progress.Dismiss(); } }
private void DownloadFile(FileSystemEntry item, string cachePath, Action onCompletion, Action <Exception> onError) { if (File.Exists(cachePath)) { Activity.ShowAlert(GetString(Resource.String.error_download_file), GetString(Resource.String.file_exists)); return; } #pragma warning disable 0618 var progress = new Android.App.ProgressDialog(Context); progress.SetCancelable(false); progress.SetMessage(GetString(Resource.String.downloading)); progress.Show(); #pragma warning restore 0618 Task.Run(async() => { try { var source = Path.Combine(workingPath, item.Name); var target = new FileStream(cachePath, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None); await(await fileSystem.ReadFileAsync(source).ConfigureAwait(false)).CopyToAsync(target).ConfigureAwait(false); await target.DisposeAsync().ConfigureAwait(false); Activity.RunOnUiThread(() => { progress.Dismiss(); onCompletion?.Invoke(); }); } catch (Exception exception) { try { File.Delete(cachePath); } catch { } Activity.RunOnUiThread(() => { progress.Dismiss(); onError?.Invoke(exception); }); } }); }
private void CheckUploadResult(object state) { Activity.RunOnUiThread(() => { progress.Hide(); progress.Dismiss(); }); if (Core.Globals.UploadAuditDBResult == UploadDBResultType.Success) { // Upload Successful Activity.RunOnUiThread(() => { ShowSuccessToast("Uploaded Successfully"); BtnUpload.Enabled = false; BtnUpload.Click += null; GlobalsAndroid.DeleteAuditDB(); }); } else if (Core.Globals.UploadAuditDBResult == UploadDBResultType.BadRequestError || Core.Globals.UploadAuditDBResult == UploadDBResultType.NetworkError) { // Bad Request Error / Network Error Activity.RunOnUiThread(() => { ShowErrorDialog("Something went wrong. Please try it later."); }); } else { // Error Activity.RunOnUiThread(() => { ShowErrorDialog("It looks like you are in an error that does not have the data service or something went wrong."); }); } }
public async Task getOrgData() { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); //dynamic value = new ExpandoObject(); //value.OrgId = orgid; // string json = JsonConvert.SerializeObject(value); try { string item = await restservice.OrgnizationList(Activity, "", location); orgmodel = JsonConvert.DeserializeObject <List <OrgModel> >(item); for (int i = 0; i < orgmodel.Count; i++) { OrgModel org = new OrgModel(); org.organizationName = orgmodel[i].organizationName; orgname.Add(org); } // db.InsertMarkingList(orgmodel); progress.Dismiss(); selectorg.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Selectorg_ItemSelected); ArrayAdapter adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, orgmodel); selectorg.Adapter = adapter; } catch (Exception ex) { progress.Dismiss(); } }
private async void getAboutExam() { progress.Show(); try { ApiResponse response = await aboutapi.GetAboutExamList(); aboutexamDictinary = response.items; Dictionary <string, AboutExamData> .KeyCollection keys = aboutexamDictinary.Keys; myFinalList = new List <AboutExamData>(); foreach (string key in keys) { myFinalList.Add(aboutexamDictinary.GetValueOrDefault(key)); aboutExamCoursename.Add(aboutexamDictinary.GetValueOrDefault(key).id); aboutExamCoursename.Add(aboutexamDictinary.GetValueOrDefault(key).name); A_Exam_ID = aboutexamDictinary.GetValueOrDefault(key).id; A_Exam_Name = aboutexamDictinary.GetValueOrDefault(key).name; dba.insertAboutExamData(A_Exam_ID, A_Exam_Name); } ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("FinalAboutExam", "true"); edit.Apply(); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); AboutExamGridAdapter videoLecture = new AboutExamGridAdapter(Activity, myFinalList); aboutgrid.Adapter = videoLecture; progress.Dismiss(); } catch (Exception e) { } }
private async void getCareerData() { progress.Show(); try { CareerModel response = await careerapi.GetCareerList(); List<ResDataCareer> resddat = response.res_data; Career = resddat[0].content_text; mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientCareer()); mWebView.LoadData("<html>" + Career + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (Career.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("CareerInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("content_text", Career); edit.Apply(); } Intent intent = new Intent(Activity, typeof(Career_Fragment)); Activity.StartActivity(intent); } catch (Exception e) { } }
private async void getJoinTelegram() { progress.Show(); try { JoinTelegramModel response = await telegramapi.GetTelegramList(); ResDataJoinTelegram resddat = response.res_data; jointelegram = resddat.content; mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientJoinTelegram(Activity)); mWebView.LoadData("<html>" + jointelegram + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (join_Telegram.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("TelegramInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("joincontent", jointelegram); edit.Apply(); } // Intent intent = new Intent(Activity, typeof(JoinTelegramFragment)); // Activity.StartActivity(intent); } catch (Exception e) { } }
private async void getclassroomList() { progress.Show(); try { ResDataClassRoom response = await classroom_ApI.GetClassRoomList(); myclassroomList = response.res_datavacancy; mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientClassRoom()); mWebView.LoadData("<html>" + myclassroomList[0].content_title + myclassroomList[0].content_text + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (classRoom.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("ClassRoomInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("classroomcontent", myclassroomList[0].content_text); edit.Apply(); } Intent intent = new Intent(Activity, typeof(JoinClassRoom_Fragment)); Activity.StartActivity(intent); } catch (Exception e) { } }