catch if G5 app is missing
This commit is contained in:
parent
a063fb05b4
commit
cb8fc905bb
|
@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.Overview;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -632,8 +633,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
CalibrationDialog calibrationDialog = new CalibrationDialog();
|
||||
calibrationDialog.show(manager, "CalibrationDialog");
|
||||
} else if (g5) {
|
||||
Intent i = new Intent("com.dexcom.cgm.activities.MeterEntryActivity");
|
||||
startActivity(i);
|
||||
try {
|
||||
Intent i = new Intent("com.dexcom.cgm.activities.MeterEntryActivity");
|
||||
startActivity(i);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
ToastUtils.showToastInUiThread(getActivity(), MainApp.gs(R.string.g5appnotdetected));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case R.id.overview_treatmentbutton:
|
||||
|
|
|
@ -935,5 +935,6 @@
|
|||
<string name="ns_create_announcements_from_errors_title">Create announcements from errors</string>
|
||||
<string name="ns_create_announcements_from_errors_summary">Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments)</string>
|
||||
<string name="dexcomG5_shortname" translatable="false">G5</string>
|
||||
<string name="g5appnotdetected">Please update your G5 app to supported version</string>
|
||||
</resources>
|
||||
|
||||
|
|
Loading…
Reference in a new issue