From 858091210c4e7c59b4ae5c2261c757c5be74474d Mon Sep 17 00:00:00 2001 From: Saran Kumar <saran.rathinavelu@gmail.com> Date: Mon, 24 Apr 2017 06:57:14 +0530 Subject: [PATCH] Saran --- .../amritaod/actionareas/applyodActivity.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/peruse/saran/amritaod/actionareas/applyodActivity.java b/app/src/main/java/com/peruse/saran/amritaod/actionareas/applyodActivity.java index 09ad585..5ab9c1d 100644 --- a/app/src/main/java/com/peruse/saran/amritaod/actionareas/applyodActivity.java +++ b/app/src/main/java/com/peruse/saran/amritaod/actionareas/applyodActivity.java @@ -59,9 +59,9 @@ public class applyodActivity extends AppCompatActivity implements AdapterView.On recievedBranch, currentdate, currentdatesend, - startperiod=null, - endperiod=null, - reason=null; + startperiod="", + endperiod="", + reason=""; private int PICK_IMAGE_REQUEST = 1, CAMERA_REQUEST = 2, startyear = calendar.get(Calendar.YEAR), @@ -178,25 +178,25 @@ public class applyodActivity extends AppCompatActivity implements AdapterView.On reason = odapplyreason.getText().toString(); startperiod = odapplystartperiod.getText().toString(); endperiod = odapplyendperiod.getText().toString(); - if(setleavetype.equals("-Select Leave Type-")){ - Toast.makeText(this,"Please Select the Leave Type", Toast.LENGTH_SHORT).show(); - } - else if(sendstartdate==null){ + if(sendstartdate==null){ Toast.makeText(this, "Please Select the Start Date", Toast.LENGTH_SHORT).show(); } else if(sendenddate==null){ Toast.makeText(this, "Please Select the End Date", Toast.LENGTH_SHORT).show(); } - else if(startperiod==null){ + else if(startperiod.equals("")){ Toast.makeText(this, "Please Select the Start Period", Toast.LENGTH_SHORT).show(); } - else if(endperiod==null){ + else if(endperiod.equals("")){ Toast.makeText(this, "Please Select the End Period", Toast.LENGTH_SHORT).show(); } - else if (reason==null){ + else if (reason.equals("")){ Toast.makeText(this, "Please give a reason", Toast.LENGTH_SHORT).show(); } - if(bitmap==null){ + else if(setleavetype.equals("-Select Leave Type-")){ + Toast.makeText(this,"Please Select the Leave Type", Toast.LENGTH_SHORT).show(); + } + else if(bitmap==null){ Toast.makeText(this, "Please Select an Image", Toast.LENGTH_SHORT).show(); } else { -- GitLab