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
By Using a Pending Intent You can Restart your Application when you want,Just use the below Lines of code
int pendingId_Intent = 987654;
Intent YourMainActivityIntent = new Intent(Context, YourMainActivity.class);
PendingIntent intentPending = PendingIntent.getActivity(context,
pendingId_Intent, YourMainActivityIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager alarm_manager =
(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarm_manager.set(AlarmManager.RTC, System.currentTimeMillis() + 100,
intentPending);
System.exit(0);