Android Toast Message is not showing
<p>I have Button.When the user click the button, there are some condition, that condition is not satisfy then need to display Toast but not showing Toast Message...</p>

<p>Code: <strong>Edited</strong></p>

<pre><code> Button addMe = (Button)findViewById(R.id.addMe);
    addMe.setOnClickListener(new OnClickListener() {
           public void onClick(View v) {
               if(selectedReason.equals("--Select--")){
                   Log.i("TAG","-----");
                   Toast.makeText(getBaseContext(), "Reason can not be blank", Toast.LENGTH_SHORT).show();
               }else if(selectedType.equals("--Select--")){
                   Toast.makeText(getParent(), "Discount type can not be blank", Toast.LENGTH_SHORT).show();
               }else{
                   if(selectedType.equals("Value")){
                       if(spc_amount.getText().toString().equals("")){
                           Log.i("TAG","-----");
                           Toast.makeText(getBaseContext(), "Discount type can not be blank", Toast.LENGTH_SHORT).show();
                       }else{
                           if(Double.parseDouble(spc_amount.getText().toString()) &gt; invoiceValue){
                               Toast.makeText(getBaseContext(), "Amonut can not be grater than invoice", Toast.LENGTH_SHORT).show();
                           }else{
                               Discount dis = new Discount();
                               dis.setCriteriaName(selectedReason);
                               dis.setDiscountValue(Double.parseDouble(spc_amount.getText().toString()));
                               spDisList.put(1,dis);
                               tl.removeAllViews();
                            loadTableLayout();
                           }

                       }
                   }
               }
           }
    });
</code></pre>

<p>I have tried context with <code>getParent()</code> , <code>getApplicationContext()</code> , <code>SpecialDiscountActivity.this</code>  &amp; <code>getBaseContext()</code> but not working....</p>

<p>This <code>Toast</code> message coming under the <code>Tab Activity Group</code></p>

<p>Please anybody help me..</p>

<p>Thanks in advance</p>
