title: Passing parameters from Javascript to Android (Java)
body: <p>I'm trying to send an email through the Android's email client. However, when I attempt to send the E-mail to the client, it says the email is null. I find that strange since I'm passing the correct parameters in JavaScript, but the app wont read it?</p>
  
  <p>I have been researching this issue for awhile now and have searched Stack Overflow for awhile.</p>
  
  <p>Anyways, my goal with this is to understand why my parameters are not being passed through.</p>
  
  <p>JavaScript:</p>
  
  <pre><code>    function sendEmailToAndroid (emailAddresses, CC, subject) {
          alert(emailAddresses); //This displays the correct address
          if (IsAndroidDevice()) {
              window.ccs.sendEmail(emailAddresses, CC, subject);
          }
      }
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>    @JavascriptInterface
      public void sendEmail(String[] emailAddress, String[] CC, String subject){
          Intent email = new Intent(Intent.ACTION_SEND);
          email.putExtra(Intent.EXTRA_EMAIL, emailAddress);
          email.putExtra(Intent.EXTRA_CC, CC);
          email.putExtra(Intent.EXTRA_SUBJECT, subject);
          email.setType("message/rfc822");
  
          if(emailAddress == null || emailAddress.length == 0){
              Toast ctoast = Toast.makeText(getApplicationContext(), "There is no email for this customer", Toast.LENGTH_LONG);
              ctoast.setGravity(Gravity.CENTER, 0, 0);
              ctoast.show();
  
              Log.d(LOG, "Email: "+emailAddress);
          }
          else{
              try{
                  startActivity(Intent.createChooser(email, "Send mail..."));
              } catch(ActivityNotFoundException e){
                  Toast.makeText(getApplicationContext(), "Failed to initalize email client!", Toast.LENGTH_LONG).show();
              }
          }
      }
  </code></pre>
  
  <p>Now when I debug the JavaScript, all parameters are being passed correctly. However, when it is read in the android app, all the values come back as null, or undefined. Which is not correct.</p>