Skip to main content

Share data android

 Intent msg = new Intent(Intent.ACTION_SEND);
 String[] recipients = { "" }; // this.is@recipient.com
  String[] carbonCopies = { "" }; // hey.another@recipient.
  msg.putExtra(Intent.EXTRA_EMAIL, recipients);
  msg.putExtra(Intent.EXTRA_CC, carbonCopies);
 msg      .putExtra(        Intent.EXTRA_TEXT,        "your text");
  // Change from ApplicationStep class subject line     // Html.
  msg.putExtra(Intent.EXTRA_SUBJECT, ApplicationStep.EMAIL_SUBJECT);     msg.putExtra(Intent.EXTRA_STREAM, Uri.parse(sUri)); // attachment
   msg.setType("image/png");  
startActivity(Intent.createChooser(msg,      "Please choose an email client"));

Comments

Popular posts from this blog

ProgressDialog example using handler android

final ProgressDialog dialog = ProgressDialog . show ( this , "Title" , "Message" , true ); final Handler handler = new Handler () { public void handleMessage ( Message msg ) { dialog . dismiss (); } } ; Thread t = new Thread () { public void run () { // write process code here. handler . sendEmptyMessage ( 0 ); } } ; t . start ();

How to set image button click effect ?

I have one simple solution: using that, you can set the default press effect to the button. // Create button and add event Button addImageView = (Button) bottomView.findViewById(R.id. addImage ); addImageView.setOnClickListener( new OnClickListener () { @Override public void onClick(View v) { // click event } }); //Using this code set touch listener addImageView.setOnTouchListener( touchEffect ); //touch listner OnTouchListener touchEffect = new OnTouchListener() {         public boolean onTouch(View v, MotionEvent event) {             switch (event.getAction()) {                 case MotionEvent. ACTION_DOWN : {                     v.getBackground().setColorFilter(0xe0f47521,PorterDuff.Mode. SRC_ATOP );                     v....