0

hi friends i have a custom list coming from server and i want to add two share buttons for Gmail and Ymail resp. in that , its like when i click the Ymail share button it asks for username and password and then redirects me into the compose message section with message body as the link of the respective list and then i can access my contacts to send it to anyone i like. 1. please tell me how to do this?? 2. is there any sdk available for Ymail/gmail

please suggest something..thanks in advance

  • 1
    For gmail, check out this post: http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-app – Khaled Nasr Oct 01 '11 at 05:07
  • thanx for replying sir, but this is now what i want....i want the when the user click on share button a pop up appears consisting of sharing icons like twitter, facebook, gmail and ymail..since the sdk available for fb and twitter i have done that but with ymail and gmail i want that when i click on each of them it asks me for gmail/ymail username and password and redirects me in the new message body with some body(i.e. a link which i have to send) and with the subject as abc..and from the app itself i can check on my gmail/ymail contacts and can send them accordingly.. –  Oct 03 '11 at 05:10

1 Answers1

1

to share text you don't pick the app you want to use. You pick the type of app you want to use. You can simply start an ACTION_SEND intent.

public void help() {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
String s = getString(R.string.sharesubject);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, s);
startActivity(sendIntent);

}

simple share intent
(source: android.com)

How about a share action provider its brand new. my 1st app has a share action provider and it looks a little like this.

share action provider

Basically you just fill up a share intent with the message and attach the intent to the share menu item.

search for share action provider example

Good Luck

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
danny117
  • 5,581
  • 1
  • 26
  • 35