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();
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue