title: Convert Java List to Javascript Array
body: <p>I have the following java code in my Android application and wanted a way to convert the Java list to an array that can be used in javascript:</p>
  
  <p>Java:</p>
  
  <pre><code>public void onCompleted(List&lt;GraphUser&gt; users, Response response) {
      for(int i = 0; i &lt; users.size(); i++)
      {
               //add to an array object that can be used in Javascript
               webView.loadUrl("javascript:fetchFriends(arrObj)");        
      }               
   }
  </code></pre>
  
  <p>Javascript: </p>
  
  <pre><code>  //this is how I want to be able to use the object in Javascript
      function parseFriends(usersObjectFromJava){
         var users = [];
          for (var i = 0; i &lt; usersObjectFromJava.length; i++) {
              var u = {
                  Id: usersObjectFromJava[i].id + "",
                  UserName: usersObjectFromJava[i].username,
                  FirstName: usersObjectFromJava[i].first_name,
                  LastName: usersObjectFromJava[i].last_name,
              };
              users[i] = u;
          }
      }
  </code></pre>
  
  <p>Could some help me with the Java code to create the usersObjectFromJava so that it can be used in javascript?</p>