It is not called by default.
@Override Public void onbackpressed() {String titlestr = Edittitle.gettext (). toString (); String contentstr = Editcontent.gettext (). toString ();if(Title.equals (TITLESTR) && content.equals (CONTENTSTR)) {Super. onbackpressed (); }Else{//Delete This article first, then create a new one soon (according to the title to delete)Datautils.deldata (title, This);//Add another piece of dataDatautils.adddata (Titlestr, Contentstr, This); Intent Intent =NewIntent ( This, Mainactivity.class); StartActivity (Intent); }
The OnCreate method is not called after if
Else later, this enables the refresh of the data in the previous activity, if written in the OnCreate method.
Http://xue163.com/588880/39060/390608984.html
How do I recall the previous activity's OnCreate method by pressing the back key in Android to return to the previous activity?