|
|
@ -343,23 +343,23 @@ public class UpdateSysConfigUtil {
|
|
|
|
//重启应用
|
|
|
|
//重启应用
|
|
|
|
public static void restartApp(Context context) {
|
|
|
|
public static void restartApp(Context context) {
|
|
|
|
|
|
|
|
|
|
|
|
Intent intent = new Intent(MicroPhotoContext.ACTION_RESTART_MP);
|
|
|
|
// Intent intent = new Intent(MicroPhotoContext.ACTION_RESTART_MP);
|
|
|
|
intent.putExtra("noDelay", 1);
|
|
|
|
// intent.putExtra("noDelay", 1);
|
|
|
|
intent.setPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
// intent.setPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
|
|
|
|
//
|
|
|
|
context.sendBroadcast(intent);
|
|
|
|
// context.sendBroadcast(intent);
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
// Thread.sleep(200);
|
|
|
|
} catch (Exception ex) {
|
|
|
|
// } catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
// ex.printStackTrace();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
PackageManager packageManager = context.getPackageManager();
|
|
|
|
PackageManager packageManager = context.getPackageManager();
|
|
|
|
|
|
|
|
|
|
|
|
intent = packageManager.getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
Intent intent = packageManager.getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
intent.putExtra("noDelay", 1);
|
|
|
|
intent.putExtra("noDelay", 1);
|
|
|
|
// intent.putExtra("reboot", 1);
|
|
|
|
// intent.putExtra("reboot", 1);
|
|
|
|
intent.addFlags(/*Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | */Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK );
|
|
|
|
context.startActivity(intent);
|
|
|
|
context.startActivity(intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|