public static void restartApp(Context activity){
  PendingIntent mPendingIntent=PendingIntent.getActivity(activity,314159,new Intent(activity,LoginActivity.class),PendingIntent.FLAG_CANCEL_CURRENT);
  AlarmManager mgr=(AlarmManager)activity.getSystemService(activity.ALARM_SERVICE);
  mgr.set(AlarmManager.RTC,System.currentTimeMillis() + 50,mPendingIntent);
  System.exit(0);
}

public static void restartApp ( Context activity ) { PendingIntent mPendingIntent = PendingIntent . getActivity ( activity , 314159 , new Intent ( activity , LoginActivity . class ) , PendingIntent . FLAG_CANCEL_CURRENT ) ; AlarmManager mgr = ( AlarmManager ) activity . getSystemService ( activity . ALARM_SERVICE ) ; mgr . set ( AlarmManager . RTC , System . currentTimeMillis ( ) + 50 , mPendingIntent ) ; System . exit ( 0 ) ; }
restart the application after 100ms
