fix dialog crash

This commit is contained in:
Milos Kozak 2016-07-15 23:58:09 +02:00
parent 9bd807ea0d
commit 489037df1a

View file

@ -16,7 +16,9 @@ import org.slf4j.LoggerFactory;
import java.util.Date; import java.util.Date;
import info.nightscout.androidaps.MainActivity; import info.nightscout.androidaps.MainActivity;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.DanaR.DanaConnection;
import info.nightscout.androidaps.plugins.DanaR.DanaRFragment; import info.nightscout.androidaps.plugins.DanaR.DanaRFragment;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
@ -73,6 +75,7 @@ public class ProfileViewDialog extends DialogFragment {
@Override @Override
public void run() { public void run() {
DanaRFragment.getDanaRPump().lastSettingsRead = new Date(0); DanaRFragment.getDanaRPump().lastSettingsRead = new Date(0);
if (DanaRFragment.getDanaConnection() == null) DanaRFragment.setDanaConnection(new DanaConnection(MainApp.bus()));
DanaRFragment.getDanaConnection().connectIfNotConnected("ProfileViewDialog"); DanaRFragment.getDanaConnection().connectIfNotConnected("ProfileViewDialog");
//refreshButton.setVisibility(View.VISIBLE); //refreshButton.setVisibility(View.VISIBLE);
} }