Android – an activity that completes another activity
What are the ways and how to complete some activities from the stack? I have a service that will look for updates. When an update is found, it will open the update activity, in which the installation prompt will be displayed. However, after the installation is completed, I want to complete the update activity, because it is not necessary to be still on the stack
thank you
resolvent:
If the update activity is starting another installation activity, you may want to override void onactivityresult (int requestcode, int resultcode, intent intent) in the update activity to provide the following implementation. In addition, when the update activity starts the installation activity, it should use startactivityforresult (intent, int) instead of startactivity (intent)
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);
finish();
}