[杞琞Android(安卓)Intent鐨勫嚑绉嶇敤娉曞叏闈㈡€荤粨
16lz
2021-01-24
Intent 搴旇绠楁槸Android涓壒鏈夌殑涓滆タ銆備綘鍙互鍦↖ntent涓寚瀹?span class="t_tag">绋嬪簭 瑕佹墽琛岀殑鍔ㄤ綔锛堟瘮濡傦細view,edit,dial锛夛紝浠ュ強绋嬪簭鎵ц鍒拌鍔ㄤ綔鏃舵墍闇€瑕佺殑璧勬枡 銆傞兘鎸囧畾濂藉悗锛屽彧瑕佽皟鐢╯tartActivity()锛孉ndroid绯荤粺 浼氳嚜鍔ㄥ鎵炬渶绗﹀悎浣犳寚瀹氳姹傜殑搴旂敤 绋嬪簭锛屽苟鎵ц璇ョ▼搴忋€?br />
涓嬮潰鍒楀嚭鍑犵Intent鐨勭敤娉?br /> 鏄剧ず缃戦〉:
璋冪敤鎷ㄥ彿绋嬪簭
璋冪敤鍙戦€?span class="t_tag">鐭俊 鐨勭▼搴?/span>
涓嬮潰鍒楀嚭鍑犵Intent鐨勭敤娉?br /> 鏄剧ず缃戦〉:
- Uri uri = Uri.parse("http://www.google.com");
- Intent it = new Intent(Intent.ACTION_VIEW,uri);
- startActivity(it);
- Uri uri = Uri.parse("geo:38.899533,-77.036476");
- Intent it = new Intent(Intent.Action_VIEW,uri);
- startActivity(it);
- Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
- Intent it = new Intent(Intent.ACTION_VIEW,URI);
- startActivity(it);
璋冪敤鎷ㄥ彿绋嬪簭
- Uri uri = Uri.parse("tel:xxxxxx");
- Intent it = new Intent(Intent.ACTION_DIAL, uri);
- startActivity(it);
- Uri uri = Uri.parse("tel.xxxxxx");
- Intent it =new Intent(Intent.ACTION_CALL,uri);
- 瑕佷娇鐢ㄨ繖涓繀椤诲湪閰嶇疆鏂囦欢 涓姞鍏?lt;uses-permission id="android .permission.CALL_PHONE" />
璋冪敤鍙戦€?span class="t_tag">鐭俊 鐨勭▼搴?/span>
- Intent it = new Intent(Intent.ACTION_VIEW);
- it.putExtra("sms_body", "The SMS text");
- it.setType("vnd.android-dir/mms-sms");
- startActivity(it);
- Uri uri = Uri.parse("smsto:0800000123");
- Intent it = new Intent(Intent.ACTION_SENDTO, uri);
- it.putExtra("sms_body", "The SMS text");
- startActivity(it);
- Uri uri = Uri.parse("content://media/external/images/media/23");
- Intent it = new Intent(Intent.ACTION_SEND);
- it.putExtra("sms_body", "some text");
- it.putExtra(Intent.EXTRA_STREAM, uri);
- it.setType("image/png");
- startActivity(it);
- Uri uri = Uri.parse("mailto:xxx@abc.com");
- Intent it = new Intent(Intent.ACTION_SENDTO, uri);
- startActivity(it);
- Intent it = new Intent(Intent.ACTION_SEND);
- 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);
- Uri uri = Uri.fromParts("package", strPackageName, null);
- Intent it = new Intent(Intent.ACTION_DELETE, uri);
- startActivity(it);
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer