mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Refresh also main activity when history editor closes
This commit is contained in:
@@ -107,6 +107,11 @@ public class HabitBroadcastReceiver extends BroadcastReceiver
|
|||||||
habit.save();
|
habit.save();
|
||||||
dismissNotification(context, habit);
|
dismissNotification(context, habit);
|
||||||
|
|
||||||
|
sendRefreshBroadcast(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendRefreshBroadcast(Context context)
|
||||||
|
{
|
||||||
LocalBroadcastManager manager = LocalBroadcastManager.getInstance(context);
|
LocalBroadcastManager manager = LocalBroadcastManager.getInstance(context);
|
||||||
Intent refreshIntent = new Intent(MainActivity.ACTION_REFRESH);
|
Intent refreshIntent = new Intent(MainActivity.ACTION_REFRESH);
|
||||||
manager.sendBroadcast(refreshIntent);
|
manager.sendBroadcast(refreshIntent);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import android.widget.TextView;
|
|||||||
import org.isoron.helpers.ColorHelper;
|
import org.isoron.helpers.ColorHelper;
|
||||||
import org.isoron.helpers.Command;
|
import org.isoron.helpers.Command;
|
||||||
import org.isoron.helpers.DialogHelper;
|
import org.isoron.helpers.DialogHelper;
|
||||||
import org.isoron.uhabits.MainActivity;
|
import org.isoron.uhabits.HabitBroadcastReceiver;
|
||||||
import org.isoron.uhabits.R;
|
import org.isoron.uhabits.R;
|
||||||
import org.isoron.uhabits.ShowHabitActivity;
|
import org.isoron.uhabits.ShowHabitActivity;
|
||||||
import org.isoron.uhabits.dialogs.HistoryEditorDialog;
|
import org.isoron.uhabits.dialogs.HistoryEditorDialog;
|
||||||
@@ -174,7 +174,7 @@ public class ShowHabitFragment extends Fragment
|
|||||||
public void onHistoryEditorClosed()
|
public void onHistoryEditorClosed()
|
||||||
{
|
{
|
||||||
refreshData();
|
refreshData();
|
||||||
MainActivity.updateWidgets(getActivity());
|
HabitBroadcastReceiver.sendRefreshBroadcast(getActivity());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshData()
|
private void refreshData()
|
||||||
|
|||||||
Reference in New Issue
Block a user