【转载】Android Intent is so powerful and great.
Android Intent is so powerful and great.
Android have lots of intent,it's powerful and useful,here is some tips for you:
1,start web browser
Uri myBlogUri = Uri.parse("http://kuikui.iteye.com");returnIt = new Intent(Intent.ACTION_VIEW, myBlogUri);
Uri mapUri = Uri.parse("geo:38.899533,-77.036476");returnIt = new Intent(Intent.ACTION_VIEW, mapUri);
Uri telUri = Uri.parse("tel:100861");returnIt = new Intent(Intent.ACTION_DIAL, telUri);
Uri callUri = Uri.parse("tel:100861");returnIt = new Intent(Intent.ACTION_CALL, callUri);
Uri uninstallUri = Uri.fromParts("package", "xxx", null);returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
Uri installUri = Uri.fromParts("package", "xxx", null);returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");returnIt = new Intent(Intent.ACTION_VIEW, playUri);
Uri emailUri = Uri.parse("mailto:shenrenkui@gmail.com");returnIt = new Intent(Intent.ACTION_SENDTO, emailUri);
returnIt = new Intent(Intent.ACTION_SEND);String[] tos = { "shenrenkui@gmail.com" };String[] ccs = { "shenrenkui@gmail.com" };returnIt.putExtra(Intent.EXTRA_EMAIL, tos);returnIt.putExtra(Intent.EXTRA_CC, ccs);returnIt.putExtra(Intent.EXTRA_TEXT, "body");returnIt.putExtra(Intent.EXTRA_SUBJECT, "subject");returnIt.setType("message/rfc882");Intent.createChooser(returnIt, "Choose Email Client");
Uri smsUri = Uri.parse("tel:100861");returnIt = new Intent(Intent.ACTION_VIEW, smsUri);returnIt.putExtra("sms_body", "shenrenkui");returnIt.setType("vnd.android-dir/mms-sms");
Uri smsToUri = Uri.parse("smsto://100861");returnIt = new Intent(Intent.ACTION_SENDTO, smsToUri);returnIt.putExtra("sms_body", "shenrenkui");
Uri mmsUri = Uri.parse("content://media/external/images/media/23");returnIt = new Intent(Intent.ACTION_SEND);returnIt.putExtra("sms_body", "shenrenkui");returnIt.putExtra(Intent.EXTRA_STREAM, mmsUri);returnIt.setType("image/png");if you have other intent,please share to me ,thx.