Here, the code is ugly simple. The truth can be even simpler: if we are too lazy to create an additional Activity to enter our fields, then we could just run our Intent.public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
public class SimpleEMail extends Activity { Button send; EditText address, subject, emailtext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_email); // send = (Button) findViewById(R.id.emailsendbutton); address = (EditText) findViewById(R.id.emailaddress); subject = (EditText) findViewById(R.id.emailsubject); emailtext = (EditText) findViewById(R.id.emailtext); send.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType( "plain/text" ); // emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String [] { address.getText().toString() }); // emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText().toString()); // emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText().toString()); // emailIntent.putExtra( android.content.Intent.EXTRA_STREAM, Uri .parse( "file://" + Environment.getExternalStorageDirectory() + "//SOTY_ATHD.mp4" )); emailIntent.setType( "text/video" ); // ! SimpleEMail. this .startActivity(Intent.createChooser(emailIntent, " ..." )); } }); } } * This source code was highlighted with Source Code Highlighter .
The method is also simple. Using the object of the MimeMessage class we compose our letter and for sending it is passed to the send method of the Transport class.* This source code was highlighted with Source Code Highlighter .
- public synchronized void sendMail ( String subject, String body, String sender, String recipients, String filename) throws Exception {
- try {
- MimeMessage message = new MimeMessage (session);
- // Who
- message.setSender ( new InternetAddress (sender));
- // About what
- message.setSubject (subject);
- // To
- if (recipients.indexOf ( ',' )> 0)
- message.setRecipients (Message.RecipientType.TO,
- InternetAddress.parse (recipients));
- else
- message.setRecipient (Message.RecipientType.TO,
- new InternetAddress (recipients));
- // wants to say
- BodyPart messageBodyPart = new MimeBodyPart ();
- messageBodyPart.setText (body);
- _multipart.addBodyPart (messageBodyPart);
- // And what to show
- if (! filename.equalsIgnoreCase ( "" )) {
- BodyPart attachBodyPart = new MimeBodyPart ();
- DataSource source = new FileDataSource (filename);
- attachBodyPart.setDataHandler ( new DataHandler (source));
- attachBodyPart.setFileName (filename);
- _multipart.addBodyPart (attachBodyPart);
- }
- message.setContent (_multipart);
- Transport.send (message);
- } catch (Exception e) {
- Log.e ( "sendMail" , "Error sending function sendMail!" );
- }
- }
Quite simply, we created an instance of the MailSenderClass class, passed the login and password to the designer. Then call sendMail send method with our parameters.* This source code was highlighted with Source Code Highlighter .
- private class sender_mail_async extends AsyncTask <Object, String , Boolean> {
- ProgressDialog WaitingDialog;
- @Override
- protected void onPreExecute () {
- // Display the loading process for the user
- WaitingDialog = ProgressDialog.show (ExtendedMail. This , "Sending data" , "We are sending a message ..." , true );
- }
- @Override
- protected void onPostExecute (Boolean result) {
- // Hide the boot process
- WaitingDialog.dismiss ();
- Toast.makeText (mainContext, "Sending complete !!!" , Toast.LENGTH_LONG) .show ();
- ((Activity) mainContext) .finish ();
- }
- @Override
- protected Boolean doInBackground (Object ... params ) {
- try {
- // Get data from our fields
- title = ((EditText) findViewById (R.id.screen_sendnews_et_title)). getText (). toString ();
- text = ((EditText) findViewById (R.id.screen_sendnews_et_text)). getText (). toString ();
- from = "from_post_msg@gmail.com" ;
- where = "where_post_msg@yandex.ru" ;
- // Call the constructor and transfer our login and password from the mailbox to gmail.com
- MailSenderClass sender = new MailSenderClass ( "mypostmail@gmail.com" , "password" );
- // And call our send method
- sender.sendMail (title, text, from , where , attach);
- } catch (Exception e) {
- Toast.makeText (mainContext, "Error sending message!" , Toast.LENGTH_SHORT) .show ();
- }
- return false ;
- }
- }
* This source code was highlighted with Source Code Highlighter .
- public void onClick (View v) {
- sender_mail_async async_sending = new sender_mail_async ();
- async_sending.execute ();
- }
Source: https://habr.com/ru/post/112450/
All Articles