mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
VX-N3
https://developer.android.com/docs/quality-guidelines/core-app-quality
This commit is contained in:
parent
6cc8fbd1e3
commit
5231f8eea5
1 changed files with 9 additions and 0 deletions
|
@ -36,6 +36,7 @@ import java.util.List;
|
|||
|
||||
public class ActivityMain extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private static final long SPLASH_DELAY = 1500L; // milliseconds
|
||||
private static final long RESTORE_STATE_INTERVAL = 3 * 60 * 1000L; // milliseconds
|
||||
private static final long SERVICE_START_DELAY = 5 * 1000L; // milliseconds
|
||||
|
||||
@Override
|
||||
|
@ -165,8 +166,16 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
|||
Intent view = new Intent(ActivityMain.this, ActivityView.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
// VX-N3
|
||||
// https://developer.android.com/docs/quality-guidelines/core-app-quality
|
||||
long now = new Date().getTime();
|
||||
long last = prefs.getLong("last_launched", 0L);
|
||||
if (now - last > RESTORE_STATE_INTERVAL)
|
||||
view.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
|
||||
Intent saved = args.getParcelable("intent");
|
||||
if (saved == null) {
|
||||
prefs.edit().putLong("last_launched", now).apply();
|
||||
startActivity(view, options);
|
||||
if (sync_on_launch)
|
||||
ServiceUI.sync(ActivityMain.this, null);
|
||||
|
|
Loading…
Reference in a new issue