|
|
|
@ -1022,13 +1022,21 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
AlarmManager mgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
|
|
|
|
|
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 1000, restartIntent); // 1秒钟后重启应用
|
|
|
|
|
System.exit(0);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
|
|
|
|
|
PendingIntent restartIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
|
|
|
|
AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
|
|
|
|
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 500, restartIntent);
|
|
|
|
|
System.exit(0);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Intent LaunchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
|
|
|
|
|
LaunchIntent.putExtra("noDelay", 1);
|
|
|
|
|
LaunchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|
context.startActivity(LaunchIntent);
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
public void enableGps(boolean enabled) {
|
|
|
|
|
SysApi.enableGps(getApplicationContext(), enabled);
|
|
|
|
|