android - How to dismiss progress dialog when i'm moving to another activity? -
I Here's my Ascenca Task Class. The and Delete your OnPostExecute a new activity started to call
pDialog.dismiss () < / Code>, but when I'm back in the last activity with new activity - the progress dialog is still going on How can I permanently transfer it to another activity at this time?
Public class FindRideTask Expands AsyncTask & lt; Zero, zero, zero> {Personal progress pDialog; @ Ovrreid protected Postaksaktek (zero results null) {if (Peediaieloji! = Null & amp; Peediaielog. Showing ISI ()) {Peedialog. } Intent = new intent (getApplicationContext (), FindRideBoard.class); Bundle bundle = new bundle (); Bundle InputSolarAralylists ("Results", Rider List); Intent.putExtras (bundle); StartActivity; } Override Protected Zero at Prexactec () {pDialog = New Progress DiDOO (FindRide.this); Pdialogkso (Findridaekthis, "× ×? × × ×? × × ¨ × × × × ×" "," × × × ?? × × × × × × × × × × × × × ?? ") ;} @ override protected Voyum Doinbakground (zero ... parameter) {s_ParseLogic = ParseLogic.getInstance (); {ArrayList & lt; ParseObject & gt; ridesFromQuery = (ArrayList & LT; ParseObject & gt;) s_ParseLogic.FindRides (sourceList. getText () toString (), destinationList.getText () toString (), time_picker.getText () toString (), m_date.getText () toString (....)); ride list = new Arrelist & lt; ride & gt ; (); for (int i = 0; i & lt; ridesFromQuery.size (); i ++) {parse object obj = ridesFromQuery.get (i); ridesList.add (new ride ((string) obj. Get ("source"), (string) obj.get ("destination"), Tring) Objkget ( "DE") (string) Objkget ( "Time"), (string) Objkget ( "Ijhfrment"), (string) Objkget ( "Driver"), (string) obj .get ("driver phone"))); }} Hold (parsexation e) {} return tap; }}
getApplicationContext () a
Your
Application reference . Then replace it with
pDialog = new ProgressDialog (YourActivityName.This);
onPostExecute () Method
@Override protected void onPostExecute (zero result) {if (pDialog! = Null & Amp; amp; p.Dialog.is Showing ()) {pDialog.dismiss (); } Intent = new intent (getApplicationContext (), FindRideBoard.class); Bundle bundle = new bundle (); Bundle InputSolarAralylists ("Results", Rider List); Intent.putExtras (bundle); StartActivity; }
UPDATE :
progressive data in
onDestroy () method your
activity .
@Override Secure void onDestroy () {// TODO Auto generated method stub super.onDestroy (); If (pDialog! = Null & amp; pDialog.is is showing ()) {pDialog.dismiss (); }}
Comments
Post a Comment