If sencha is not set, it is a framework page. When you click the return key of a browser or Android, the page or the entire program will pop out.
Therefore, you need to implement the route path
I have provided a detailed description on the Internet. I have been studying it for a long time.
First, you must add the historical path at the beginning of main. In app. js
Launch: function (){
// Add the historical path and set main to home.
This. getApplication (). getHistory (). add (Ext. create ('ext. app. action ',{
Url: 'home'
}));
// Initialize main
Ext. create ('mbapeople. view. main', {fullscreen: true });
}
Second, define a route event in the controller.
Routes :{
'Home': 'homedump ',
'Changepass': 'changejump'
},
Home is the name, followed by the method
Changejump: function (){
Var form = this. getChangepassword ();
Ext. Viewport. setActiveItem (form)
},
Homejump: function (){
Var form = this. getMainview ();
Ext. Viewport. setActiveItem (form)
},
Then, it is called in the corresponding button event.
In the changepassword button, the write is not setActiveitem, but history.
OnBtnTap: function (){
This. getApplication (). getHistory (). add (Ext. create ('ext. app. action ',{
Url: 'changepass'
}));
}
You can directly use history. back () on the return button ();
Handler: function (){
History. back ();
}
In this way, when we initialize main, we will find that the home address is localhost/app/# home, and the jump page address is localhost/app/# changepass, which becomes two pages, naturally, return buttons can be implemented.