How to restart previous activity in android? -
in android app, have activity displays profile information. opens new activity make changes activity. after save changes, closes edit activity edit activity, goes profile displaying activity, there need restart activity refresh data.
is there way can restart activity opened current activity?
there 3 ways can achieve want:
- start profile activity calling
startactivityforresult()
, refresh data inonactivityresult()
finish()
activity when start profile activity , overrideonbackpress()
in profile activity start previous activity , callfinish()
.- override
onbackpress()
in profile activity start previous activity flagintent.flag_activity_clear_top
, refresh data inonnewintent()
Comments
Post a Comment