Some models after clicking the Home button to return to the main page and then click on the icon to enter the program have found no previous interface.
Solution:
1, we add the following methods in the base class Activity:
@Override
public boolean moveTaskToBack(boolean nonRoot) {
return super.moveTaskToBack(nonRoot);
}
2, in onCreate program just started the page Activity () method to add:
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!this.isTaskRoot()) {
Intent mainIntent = getIntent();
String action = mainIntent.getAction();
if (mainIntent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
finish();
return;
}
}
}
Most of this problem will be solved.