Answer the question
In order to leave comments, you need to log in
Why onfinish(); closes the whole application?
It is necessary to close the current activity when calling the method onfinish();
and return to the main one, but instead the entire application is closed. I pass from MainActivity to ActivityAbout and back. What is the problem? Maybe add something to the manifest?
MainActivity.class
public void onClickGo(View view) {
Intent intent = new Intent(MainActivity.this, ActivityAbout.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
public void onClickBack(View view) {
finish();
}
Answer the question
In order to leave comments, you need to log in
Because we are reading the FLAG_ACTIVITY_NEW_TASK documentation . You don't need this flag.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question