我现在做一个应用,比如说其中的一项功能是收发e-mail,android系统不是本身带有e-mail功能么,那怎么样可以把系统自带的功能弄到我的应用中来?

解决方案 »

  1.   

    sdk 文档上有说明android_sdk/docs/guide/appendix/g-app-intents.html
      

  2.   

    在Android中调用系统功能,一般是通过Intent
      

  3.   

    可惜文档不全,唉
    这里有几种email的方式,可以参考Uri uri = Uri.parse("mailto:[email protected]");
    Intent it = new Intent(Intent.ACTION_SENDTO, uri);
    startActivity(it);Intent it = new Intent(Intent.ACTION_SEND);   
    it.putExtra(Intent.EXTRA_EMAIL, "[email protected]");   
    it.putExtra(Intent.EXTRA_TEXT, "The email body text");   
    it.setType("text/plain");   
    startActivity(Intent.createChooser(it, "Choose Email Client"));  Intent it=new Intent(Intent.ACTION_SEND);     
    String[] tos={"[email protected]"};     
    String[] ccs={"[email protected]"};     
    it.putExtra(Intent.EXTRA_EMAIL, tos);     
    it.putExtra(Intent.EXTRA_CC, ccs);     
    it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
    it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
    it.setType("message/rfc822");     
    startActivity(Intent.createChooser(it, "Choose Email Client"));   
      

  4.   

    关于楼主的问题,只要指定email地址,然后发个intent就可以把Email启动起来了:Uri uri = Uri.parse("mailto:[email protected]"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); startActivity(it); 
      

  5.   

    请问,这些URI是在哪看到的,例如短信的“smsto:”,我在文档里没找到这块。
    你的信息对我非常有用,谢谢!
      

  6.   

    不错,希望高手加 83546292 群 ,一起学研究Android