mirror of https://github.com/M66B/FairEmail.git
Refresh on widget tap
This commit is contained in:
parent
59b79bac2b
commit
68acb278a3
|
@ -84,11 +84,10 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
|||
@Override
|
||||
protected void onExecuted(Bundle args, Boolean hasAccounts) {
|
||||
if (hasAccounts) {
|
||||
startActivity(new Intent(ActivityMain.this, ActivityView.class));
|
||||
if (ACTION_REFRESH.equals(getIntent().getAction()))
|
||||
ServiceSynchronize.process(ActivityMain.this, true);
|
||||
else
|
||||
ServiceSynchronize.watchdog(ActivityMain.this);
|
||||
Intent view = new Intent(ActivityMain.this, ActivityView.class);
|
||||
view.putExtra("refresh", true);
|
||||
startActivity(view);
|
||||
ServiceSynchronize.watchdog(ActivityMain.this);
|
||||
ServiceSend.watchdog(ActivityMain.this);
|
||||
} else
|
||||
startActivity(new Intent(ActivityMain.this, ActivitySetup.class));
|
||||
|
|
|
@ -473,6 +473,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
private void checkIntent() {
|
||||
Intent intent = getIntent();
|
||||
|
||||
if (intent.getBooleanExtra("refresh", false)) {
|
||||
intent.removeExtra("refresh");
|
||||
setIntent(intent);
|
||||
ServiceSynchronize.process(this, true);
|
||||
}
|
||||
|
||||
String action = intent.getAction();
|
||||
Log.i("View intent=" + intent + " action=" + action);
|
||||
if (action != null) {
|
||||
|
|
|
@ -55,6 +55,7 @@ public class Widget extends AppWidgetProvider {
|
|||
private static void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds, int count) {
|
||||
Intent view = new Intent(context, ActivityView.class);
|
||||
view.setAction("unified");
|
||||
view.putExtra("refresh", true);
|
||||
view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pi = PendingIntent.getActivity(context, ActivityView.REQUEST_UNIFIED, view, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
|
|
Loading…
Reference in New Issue