Quick Question About Intents


Last Updated:

  1. Forest Marie

    Forest Marie Member This Topic's Starter

    Joined:
    Dec 29, 2009
    Messages:
    5
    Likes Received:
    0
    I have the following event handling code for a button click event here:

    Code (Text):
    1.  
    2.         ibtnShare.setOnClickListener(new OnClickListener() {
    3.          public void onClick(View v){
    4.           Intent emailIntent  = new Intent(android.content.Intent.ACTION_SEND);
    5.           emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Check this out");
    6.           emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, facts[position]);
    7.           emailIntent.setType("text/plain");
    8.           startActivity(Intent.createChooser(emailIntent, "Send mail..."));
    9.          }
    10.         });
    11.  
    Whenever I click the button, it pulls up an option to send the data via text or email. How would one set this to where it only sends it via text message or via E-Mail?

    Also is there any examples out there to show how to send something real simple to your Twitter or Facebook account?

    Much thanks and kudos in advance.

    - Forest
     

    Advertisement

Share This Page

Loading...