title: how to print the email in android
body: <p>I am not able to send the email through editText .If I typed the email abc@gmail.com then I am able to print the email like abc. How I can read the full email abc@gmail.com.I am using this library <a href="https://github.com/splitwise/TokenAutoComplete/" rel="nofollow">https://github.com/splitwise/TokenAutoComplete/</a> and I am using following code in activity.How I can print the entered editText email in log.And How I can get this email in webservice.</p>
  
  <pre><code>public class Share_Activity extends Activity implements TokenCompleteTextView.TokenListener{
  
      ContactsCompletionView completionView;
      Person[] people;
      ArrayAdapter&lt;Person&gt; adapter;
  
      Button btnCancel,btnShare;
      EditText email_Text,email_Message;
      TextView share_text ;
  
      String alternate_id;
      String bookmark_title;
      String bookmark_url;
      String meassage;
      String email;
      String allemails;
      List&lt;String&gt; emails = new ArrayList&lt;String&gt;();
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_share);
  
          btnCancel =(Button) findViewById(R.id.share_cancel);
          btnShare =(Button) findViewById(R.id.share_button);
          share_text =(TextView) findViewById(R.id.share_text);
         // email_Text =(EditText) findViewById(R.id.share_email_text);
          email_Message =(EditText) findViewById(R.id.message_text);
  
  
          if (savedInstanceState == null) {
              Bundle extras = getIntent().getExtras();
  
              if (extras == null) {
  
                  alternate_id = null;
                  bookmark_title = null;
                  bookmark_url = null;
  
  
              } else {
                  alternate_id = extras.getString("alternate_id");
                  bookmark_title = extras.getString("bookmark_title");
                  bookmark_url = extras.getString("bookmark_url");
  
  
              }
          } else {
              alternate_id = (String) savedInstanceState.getSerializable("alternate_id");
              bookmark_title = (String) savedInstanceState.getSerializable("bookmark_title");
              bookmark_url = (String) savedInstanceState.getSerializable("bookmark_url");
  
          }
  
            System.out.println(alternate_id);
            System.out.println(bookmark_title);
            System.out.println(bookmark_url);
            System.out.println("Value recevied");
  
  
          people = new Person[]{};
  
  
  
        /*  people = new Person[emails.size()];
          for(int i=0;i&lt;emails.size();i++)
          {
  
              people[i]=new Person("",emails.get(i));
          }
          allemails= TextUtils.join(",", emails);
          Log.i("Result", allemails);*/
          adapter = new FilteredArrayAdapter&lt;Person&gt;(this, R.layout.person_layout, people) {
              @Override
              public View getView(int position, View convertView, ViewGroup parent) {
                  if (convertView == null) {
  
                      LayoutInflater l = (LayoutInflater)getContext().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
                      convertView = l.inflate(R.layout.person_layout, parent, false);
                  }
  
                  Person p = getItem(position);
                  ((TextView)convertView.findViewById(R.id.name)).setText(p.getName());
                  ((TextView)convertView.findViewById(R.id.email)).setText(p.getEmail());
  
                  return convertView;
              }
  
              @Override
              protected boolean keepObject(Person person, String mask) {
                  mask = mask.toLowerCase();
                  return person.getName().toLowerCase().startsWith(mask) || person.getEmail().toLowerCase().startsWith(mask);
              }
          };
  
  
  
          completionView = (ContactsCompletionView)findViewById(R.id.share_email_text);
  
          System.out.println(completionView);
  
          System.out.println("sngfh");
          completionView.setAdapter(adapter);
          completionView.setTokenClickStyle(TokenCompleteTextView.TokenClickStyle.Select);
          completionView.setTokenListener(this);
  
          if (savedInstanceState == null) {
             // completionView.setPrefix("To: ");
             // completionView.addObject(people[0]);
             // completionView.addObject(people[1]);
          }
          btnShare.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  Intent in = new Intent(getApplicationContext(), Dashboard.class);
                  people = new Person[emails.size()];
                  for(int i=0;i&lt;emails.size();i++)
                  {
                      people[i]=new Person("",emails.get(i));
                      System.out.println(emails.get(i));
                      System.out.println("hiiiiiii");
                  }
  
                  allemails = TextUtils.join(",", emails);
                  System.out.println(allemails);
                  System.out.println("allmailsca");
                  meassage  = email_Message.getText().toString();
                  allemails = completionView.getText().toString();
  
                  System.out.println(meassage);
                  System.out.println(allemails);
  
                  new Share_LoaderTask().execute("https://www.myssite.com/users/sharearticle?", "access_token", alternate_id, bookmark_title, bookmark_url, meassage, allemails);
                  startActivity(in);
              }
          });
  
      }
      class Share_LoaderTask extends AsyncTask&lt;String, String, String&gt;
      {
  
          @Override
          protected String doInBackground(String... params) {
              HttpParams httpParameters = new BasicHttpParams();
              HttpConnectionParams.setConnectionTimeout(httpParameters, 5000);
              HttpConnectionParams.setSoTimeout(httpParameters, 5000);
              HttpClient httpClient = new DefaultHttpClient(httpParameters);
              HttpPost httpPost = new HttpPost(params[0]);
              // HttpPost httpPost = new HttpPost("https://www.mysites.com/secure-mobile/note?");
  
              String jsonResult = "";
              try {
  
                  List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(6);
  
                  nameValuePairs.add(new BasicNameValuePair("access_token", "94529e5dbc6234fc3bbfce7406b8dde9"));
                  nameValuePairs.add(new BasicNameValuePair("alternateId",alternate_id));
                  nameValuePairs.add(new BasicNameValuePair("bookmarkTitle",bookmark_title));
                  nameValuePairs.add(new BasicNameValuePair("bookmarkUrl",bookmark_url));
                  nameValuePairs.add(new BasicNameValuePair("emails",allemails));
                  nameValuePairs.add(new BasicNameValuePair("message",meassage));
  
                  httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                  System.out.println(convertStreamToString(httpPost.getEntity().getContent()));
                  System.out.println("Hiiiiiii");
                  HttpResponse response = httpClient.execute(httpPost);
  
                  int status = 200;
  
                  if (status == 200) {
                      HttpEntity entity = response.getEntity();
                      String data = EntityUtils.toString(entity);
                      System.out.println(data);
                      System.out.println("fffff");
                      JSONObject jsono = new JSONObject(data);
                      for (int i = 0; i &lt; jsono.length(); i++)
                      {
  
                      }
                      return null;
                  }
  
                  //------------------&gt;&gt;
  
              } catch (ParseException e1) {
                  e1.printStackTrace();
              } catch (IOException e) {
                  e.printStackTrace();
              } catch (JSONException e) {
                  e.printStackTrace();
              }
              return null;
          }
      }
      private static String convertStreamToString(InputStream is) {
          StringBuilder sb = new StringBuilder();
          try {
              BufferedReader reader = new BufferedReader(new InputStreamReader(is));
  
              String line = null;
              while ((line = reader.readLine()) != null) {
                  sb.append(line);
              }
              is.close();
  
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return sb.toString();
      }
      private void updateTokenConfirmation() {
  
          emails = new ArrayList&lt;String&gt;();
          StringBuilder sb = new StringBuilder("Current tokens:\n");
          for (Object token: completionView.getObjects())
          {
  
              System.out.println(completionView.getObjects());
              System.out.println("hiiii");
              sb.append(token.toString());
              emails.add(token.toString());
              System.out.println(String.valueOf(emails.size()));
              System.out.println("hiiiiisfsfs");
              //System.out.println(emails.add(token.toString()));
              sb.append("\n");
          }
          System.out.println(sb);
          //((TextView)findViewById(R.id.tokens)).setText(sb);
      }
      @Override
      public void onTokenAdded(Object token) {
  
          updateTokenConfirmation();
  
      }
  
      @Override
      public void onTokenRemoved(Object token) {
          updateTokenConfirmation();
      }
  }
  </code></pre>