直接贴代码:
Intent intent = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());
PendingIntent restartIntent = PendingIntent.getActivity( getContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);
AlarmManager mgr = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis(), restartIntent);
System.exit(0);
可用于app 的刷新等