This commit is contained in:
Milos Kozak 2017-09-24 22:47:50 +02:00
commit d9f59840b6
6 changed files with 10 additions and 6 deletions

View file

@ -10,6 +10,7 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshGui;
@ -73,6 +74,9 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage());
pref.setSummary(editTextPref.getText());
}
else if(pref.getKey().contains("smscommunicator_allowednumbers") && TextUtils.isEmpty(editTextPref.getText().toString().trim())){
pref.setSummary(MainApp.sResources.getString(R.string.smscommunicator_allowednumbers_summary));
}
}
if (pref instanceof MultiSelectListPreference) {
EditTextPreference editTextPref = (EditTextPreference) pref;

View file

@ -180,7 +180,7 @@ public class FillDialog extends DialogFragment implements OnClickListener {
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
} catch (WindowManager.BadTokenException | NullPointerException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));

View file

@ -112,7 +112,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
builder.setMessage(result.comment);
builder.setPositiveButton(context.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
} catch (WindowManager.BadTokenException | NullPointerException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));

View file

@ -127,7 +127,7 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
} catch (WindowManager.BadTokenException | NullPointerException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));

View file

@ -367,7 +367,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
} catch (WindowManager.BadTokenException | NullPointerException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));

View file

@ -713,7 +713,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
} catch (WindowManager.BadTokenException | NullPointerException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));