Use OK/Cancel buttons for profile removal dialog.

This commit is contained in:
Johannes Mockenhaupt 2017-08-17 21:17:31 +02:00
parent 6c8e957a33
commit 4f2357e9fb
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -130,9 +130,11 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
final ProfileSwitch profileSwitch = (ProfileSwitch) v.getTag();
switch (v.getId()) {
case R.id.profileswitch_remove:
OKDialog.show(getActivity(), MainApp.sResources.getString(R.string.confirmation), MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(profileSwitch.date), new Runnable() {
@Override
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(profileSwitch.date));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
final String _id = profileSwitch._id;
if (_id != null && !_id.equals("")) {
NSUpload.removeCareportalEntryFromNS(_id);
@ -140,6 +142,8 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
MainApp.getDbHelper().delete(profileSwitch);
}
});
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
builder.show();
break;
case R.id.profileswitch_date:
case R.id.profileswitch_name: