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) { } }
//public bool permissionmethodAsync() //{ // GetPermissionAsync(); // return true; //} //private async Task GetPermissionAsync() //{ // List<String> permissions = new List<String>(); // try // { // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessFineLocation) == Permission.Denied) // { // permissions.Add(Manifest.Permission.AccessFineLocation); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.RecordAudio) == Permission.Denied) // { // permissions.Add(Manifest.Permission.RecordAudio); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessCoarseLocation) == Permission.Denied) // { // permissions.Add(Manifest.Permission.AccessCoarseLocation); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.Camera) == Permission.Denied) // { // permissions.Add(Manifest.Permission.Camera); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.ReadExternalStorage) == Permission.Denied) // { // permissions.Add(Manifest.Permission.ReadExternalStorage); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.WriteExternalStorage) == Permission.Denied) // { // permissions.Add(Manifest.Permission.WriteExternalStorage); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.CallPhone) == Permission.Denied) // { // permissions.Add(Manifest.Permission.CallPhone); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.ReadPhoneState) == Permission.Denied) // { // permissions.Add(Manifest.Permission.ReadPhoneState); // } // if (permissions.Count > 0) // { // ActivityCompat.RequestPermissions(Activity, permissions.ToArray(), 100); // } // if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessFineLocation) == Permission.Granted) // { // geo = new Geolocation(); // } // } // catch (Exception e) // { // System.Console.WriteLine("Error", e.Message); // } //} public async Task GetLogin() { Boolean result = ic.connectivity(); if (result) { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); JsonValue login_value = null; try { login_value = await nextActivity("", ""); } catch (Exception e) { } if (login_value != null) { await ParseAndDisplay(login_value, ""); } } }
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(); }
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) { } }
//public override void OnActivityCreated(Bundle savedInstanceState) //{ // base.OnActivityCreated(savedInstanceState); // DoWork(); //} private async void DoWork() { var pr = new Android.App.ProgressDialog(globalContext); pr.SetMessage("Loading data"); pr.SetCancelable(false); pr.Show(); var repository = new Respository(); //var channel = await await Task.Factory.StartNew(async() =>await repository.ReadPsi());//repository.ReadPsi(); //var channel = await await await Task.Factory.StartNew(() =>repository.ReadPsi().ContinueWith<Task<Channel>>(t=>t,TaskContinuationOptions.OnlyOnFaulted)); await Task.Factory.StartNew(() => BigLongImportantMethodAsync()); var channel = _channelResult; var psiInfo = PsiInformation.Parse(channel); var view = globalView; var foundTextbox = view.FindViewById <TextView>(Resource.Id.textViewUpdateTime); foundTextbox.Text = psiInfo.DisplayUpdateTime; foundTextbox = view.FindViewById <TextView>(Resource.Id.textView3hrPsi); foundTextbox.Text = psiInfo.Psi3Hour; foundTextbox = view.FindViewById <TextView>(Resource.Id.textView24hrPsi); foundTextbox.Text = psiInfo.Psi24Hour; var root = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutRoot); root.Visibility = ViewStates.Visible; pr.Hide(); }
private void PerformUpdate() { EdiabasInit(); Android.App.ProgressDialog progress = new Android.App.ProgressDialog(this); progress.SetCancelable(false); progress.SetMessage(GetString(Resource.String.can_adapter_fw_update_active)); progress.Show(); _adapterThread = new Thread(() => { bool updateOk = false; bool connectOk = false; try { connectOk = !InterfacePrepare(); BluetoothSocket bluetoothSocket = EdBluetoothInterface.BluetoothSocket; if (bluetoothSocket == null) { connectOk = false; } else { connectOk = true; updateOk = PicBootloader.FwUpdate(bluetoothSocket); } } catch (Exception) { updateOk = false; } RunOnUiThread(() => { if (IsJobRunning()) { _adapterThread.Join(); } progress.Hide(); progress.Dispose(); string message; if (updateOk) { message = GetString(Resource.String.can_adapter_fw_update_ok); } else { message = connectOk ? GetString(Resource.String.can_adapter_fw_update_failed) : GetString(Resource.String.can_adapter_fw_update_conn_failed); } _activityCommon.ShowAlert(message, updateOk ? Resource.String.alert_title_info : Resource.String.alert_title_error); UpdateDisplay(); if (updateOk) { PerformRead(); } }); }); _adapterThread.Start(); UpdateDisplay(); }
private void ShowProgressDialog() { progress = new Android.App.ProgressDialog(this.Context); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetMessage("Please wait..."); progress.SetCancelable(false); progress.Show(); }
public void LoadingShow() { progress = new Android.App.ProgressDialog(Forms.Context); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetMessage("Carregando, por favor aguarde..."); progress.SetCancelable(false); progress.Show(); }
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(); } }
public async void Validate() { var errorMsg = ""; if (user.Text.Length == 0 && pass.Text.Length == 0) { if (user.Text.Length == 0 || pass.Text.Length == 0) { errorMsg = "Please enter User Name "; } if (pass.Text.Length == 0 || pass.Text.Length == 0) { errorMsg = errorMsg + "Please enter Password"; } Toast.MakeText(Activity, errorMsg, ToastLength.Long).Show(); return; } else { Boolean result = ic.connectivity(); if (result) { progress = new Android.App.ProgressDialog(Activity); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetCancelable(false); progress.SetMessage("Please wait..."); progress.Show(); JsonValue login_value = null; try { login_value = await nextActivity(user.Text, pass.Text); } catch (Exception e) { } if (login_value != null) { await ParseAndDisplay(login_value, user.Text); } // loginId1 = user.Text; // password1 = pass.Text; } else { Toast.MakeText(Activity, "No Internet", ToastLength.Long).Show(); } } }
private void UpdateAvatar(Uri uri) { var image = storageReference.Child($"Images/{System.Guid.NewGuid()}"); var title = Resources.GetString(Resource.String.change_avatar); var message = Resources.GetString(Resource.String.wait); progressDialog = Context.CreateDialog(title, message); progressDialog.Show(); image.PutFile(uri) .AddOnSuccessListener(this) .AddOnFailureListener(this); }
protected override void OnAttachedTo(Page bindable) { base.OnAttachedTo(bindable); #if __ANDROID__ renderObj = new Android.App.ProgressDialog(HandSchool.Droid.MainActivity.ActivityContext); renderObj.SetTitle(Title); renderObj.SetMessage(Tips); renderObj.Indeterminate = true; renderObj.Show(); #elif __IOS__ #elif __UWP__ bindable.IsBusy = true; #endif }
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 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 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 LoginButton_Click(object sender, EventArgs e) { _loginButton.Enabled = false; var pr = new Android.App.ProgressDialog(_context); pr.SetMessage("Login..."); pr.SetCancelable(false); pr.Show(); await Task.Factory.StartNew(() => BigLongImportantMethodAsync()); pr.Hide(); _loginButton.Enabled = true; }
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 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 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(); } }
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) { } }
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 getContactUs() { progress.Show(); try { ContactUsModel response = await contactusapi.GetAboutExamList(); ResData resddat = response.res_data; content = resddat.content; mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientContactUs()); mWebView.LoadData("<html>" + content + "</html>", "text/html", "utf-8"); progress.Dismiss(); if (contactus.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("UserInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("contentt", content); edit.Apply(); } Intent intent = new Intent(Activity, typeof(ContactUsFragment)); Activity.StartActivity(intent); //Activity.FragmentManager.PopBackStack(); } catch (Exception e) { } }
/** * Performs a task in the background, showing an indeterminate {@link ProgressDialog}, * while the {@link AsyncCallable} is being processed. * * @param <T> * @param pTitleResID * @param pMessageResID * @param pErrorMessageResID * @param pAsyncCallable * @param pCallback * @param pExceptionCallback */ protected void DoAsync <T>(int pTitleResID, int pMessageResID, andengine.util.AsyncCallable <T> pAsyncCallable, andengine.util.Callback <T> pCallback, andengine.util.Callback <Exception> pExceptionCallback) { ProgressDialog pd = ProgressDialog.Show(this, this.GetString(pTitleResID), this.GetString(pMessageResID)); /* * pAsyncCallable.Call(new Callback<T>() { * @Override * public void onCallback(final T result) { * try { * pd.dismiss(); * } catch (final Exception e) { * Debug.e("Error", e); * /* Nothing. * / * } * * pCallback.onCallback(result); * } * }, pExceptionCallback); */ pAsyncCallable.Call(new DoAsync_Callback <T>(this, pd, pCallback), pExceptionCallback); }