|
|
|
@ -1351,24 +1351,15 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
|
|
|
|
|
public static void restartApp(Context context, String packageName, String reason) {
|
|
|
|
|
|
|
|
|
|
// Intent intent = new Intent(context, MainActivity.class);
|
|
|
|
|
// int noDelay = 1;
|
|
|
|
|
// intent.putExtra("noDelay", noDelay);
|
|
|
|
|
// if (!TextUtils.isEmpty(reason)) {
|
|
|
|
|
// intent.putExtra("reason", reason);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
|
|
|
// context.startActivity(intent);
|
|
|
|
|
// System.exit(0);
|
|
|
|
|
|
|
|
|
|
Intent restartIntent = new Intent();
|
|
|
|
|
restartIntent.putExtra("cmd", "forceLaunch");
|
|
|
|
|
restartIntent.putExtra("pkname", packageName);
|
|
|
|
|
restartIntent.setAction("com.xy.xsetting.action");
|
|
|
|
|
restartIntent.setPackage("com.android.systemui");
|
|
|
|
|
context.sendBroadcast(restartIntent);
|
|
|
|
|
android.os.Process.killProcess(android.os.Process.myPid());
|
|
|
|
|
Intent intent = new Intent(context, MainActivity.class);
|
|
|
|
|
int noDelay = 1;
|
|
|
|
|
intent.putExtra("noDelay", noDelay);
|
|
|
|
|
if (!TextUtils.isEmpty(reason)) {
|
|
|
|
|
intent.putExtra("reason", reason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
System.exit(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|