I have an application which starts a Remote Service in its first launched activity. Then, in another activity, the user can set the configuration of the application. Please note that this second activity isn't bound to the Service and I don't wish to bind it.
Now my question is : how could I restart the whole application from the second activity, after changing the configuration settings?
For now, I am using a button which onClickListener is :
public void onClick(DialogInterface dialog, int which) {
sauvegarde();
Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
The problem is : it only restarts the current activity without shutting the whole application, and therefore, without restarting the service
Any ideas?
Restart apps command isn't something new to Windows 10. In fact, it is available in the Settings since 2017. It can be found under Settings > Accounts > Sign-in options > Restart apps. With this option enabled, Windows 10 automatically restarts all the open apps the next time you turn on or restart your computer.
Ctrl + Alt + Del.
1. Default apps. For starters, resetting will clear all the default apps. For instance, when you download a third-party gallery app, if you open a photo via file explorer, your phone will ask you to choose a default app. You'll be provided with two options – Once and Always.
: to launch (something) again or to be launched again relaunch a ship Instead of letting the app close, then … waiting while the app relaunches, you can tell your iPad to abort your now-unwanted Home button press.—
try this
public void reload() {
Intent intent = getIntent();
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
overridePendingTransition(0, 0);
startActivity(intent);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With