Use OK/Cancel buttons for profile removal dialog.
This commit is contained in:
parent
6c8e957a33
commit
4f2357e9fb
|
@ -130,9 +130,11 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
|
||||||
final ProfileSwitch profileSwitch = (ProfileSwitch) v.getTag();
|
final ProfileSwitch profileSwitch = (ProfileSwitch) v.getTag();
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.profileswitch_remove:
|
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() {
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
@Override
|
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
|
||||||
public void run() {
|
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;
|
final String _id = profileSwitch._id;
|
||||||
if (_id != null && !_id.equals("")) {
|
if (_id != null && !_id.equals("")) {
|
||||||
NSUpload.removeCareportalEntryFromNS(_id);
|
NSUpload.removeCareportalEntryFromNS(_id);
|
||||||
|
@ -140,6 +142,8 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
|
||||||
MainApp.getDbHelper().delete(profileSwitch);
|
MainApp.getDbHelper().delete(profileSwitch);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
|
||||||
|
builder.show();
|
||||||
break;
|
break;
|
||||||
case R.id.profileswitch_date:
|
case R.id.profileswitch_date:
|
||||||
case R.id.profileswitch_name:
|
case R.id.profileswitch_name:
|
||||||
|
|
Loading…
Reference in a new issue