开发学院手机开发Android 开发 调用android系统自带功能 阅读

调用android系统自带功能

 2010-07-21 01:20:00 来源:WEB开发网   
核心提示:it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");it.putExtra(Intent.EXTRA_TEXT, "The email body text");it.setType("text/plain");start

it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");

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={"me@abc.com"};

String[] ccs={"you@abc.com"};

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"));

复制代码添加附件 Intent it = new Intent(Intent.ACTION_SEND);

it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");

it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");

sendIntent.setType("audio/mp3");

startActivity(Intent.createChooser(it, "Choose Email Client"));

复制代码播放多媒体

Intent it = new Intent(Intent.ACTION_VIEW);

Uri uri = Uri.parse("file:///sdcard/song.mp3");

it.setDataAndType(uri, "audio/mp3");

startActivity(it);

复制代码Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");

Intent it = new Intent(Intent.ACTION_VIEW, uri);

startActivity(it);

复制代码Uninstall 程序 Uri uri = Uri.fromParts("package", strPackageName, null);

Intent it = new Intent(Intent.ACTION_DELETE, uri);

startActivity(it);

sdk 文档 android_sdk/docs/guide/appendix/g-app-intents.html

上一页  1 2 

Tags:调用 android

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接