title: Show toast in onActivityResult
body: <p>I am attempting to show a toast message when an activity returns with a result. However, I am using a custom inflated toast. Regular toast works fine, but my custom toast won't display. Code below.</p>
  
  <p>Main Activity's <code>onCreate()</code>:</p>
  
  <pre><code>@Override
      public void onCreate(Bundle savedInstance){
          super.onCreate(savedInstance);
          setContentView(R.layout.activity_login);
  
          emailTxt = (TextView)this.findViewById(R.id.email_field);
          passwordTxt = (TextView)this.findViewById(R.id.password_field);
  
          wgmService = ((MainApp)this.getApplication()).wegmannAdapter.create(WegmannService.class);
  
          spinner = (ProgressBar)this.findViewById(R.id.progress_bar);
          spinner.setVisibility(View.GONE);
  
          LayoutInflater inflater = getLayoutInflater();
          View layout = inflater.inflate(R.layout.toast, (ViewGroup)findViewById(R.id.toast_layout));
          toastText = (TextView)layout.findViewById(R.id.toast_text);
          toast = new Toast(getApplicationContext());
          toast.setGravity(Gravity.BOTTOM, 0, 0);
          toast.setDuration(Toast.LENGTH_LONG);
          toast.setView(layout);
  
          fadeIn = AnimationUtils.loadAnimation(this,  R.anim.fade_in);
          fadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out);
      }
  </code></pre>
  
  <p>Main Activity's <code>onActivityResult</code>:</p>
  
  <pre><code>@Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data){
          switch(requestCode) {
              case SIGNUP_VIEW:
                  if(resultCode == RESULT_OK){
                      toastText.setText(data.getExtras().getString("message"));
                      toast.show();
                  }
                  break;
          }
      }
  </code></pre>
  
  <p>With the above, I see no toast message. However, if I were to replace the lines in onActivityResult with <code>Toast.makeText(getBaseContext(),"MESSAGE", Toast.LENGTH_LONG).show()</code>, a message does appear. I need to be able to use my custom toast in this instance. Any help or direction appreciated.</p>