调用系统拨号
Intent intent = new Intent();
intent.setAction("android.intent.action.CALL_BUTTON");
startActivity(intent);
调用系统的发短信功能:
Uri smsToUri = Uri.parse("smsto:");
Intent mIntent = new Intent( android.content.Intent.ACTION_SENDTO, smsToUri );
mIntent.putExtra("sms_body", "");
startActivity( mIntent );
调用系统的相机功能:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(intent);
权限<uses-permission android:name="android.permission.CAMERA"/>
调用系统相册
Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
intent.putExtra("return-data", true);
startActivityForResult(intent, 0);
调用音乐播放器
Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");
startActivity(intent);
调用本机的视频播放器
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("video/*");
startActivity(intent);
调用系统的计算器
Intent mIntent = new Intent();
mIntent.setClassName("com.android.calculator2","com.android.calculator2.Calculator");
startActivity(mIntent);
加权限<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
调用系统录像机
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0.9);
startActivity(intent);
录音机
Intent intent=new Intent(Media.RECORD_SOUND_ACTION);
startActivity(intent);
调用闹钟
Intent alarmas = new Intent(AlarmClock.ACTION_SET_ALARM);
startActivity(alarmas);
本文介绍了如何在Android应用中调用系统自带的各种功能,包括拨打电话、发送短信、使用相机、选择相册图片、播放音乐及视频、启动计算器等,并提供了具体的Intent调用示例。

被折叠的 条评论
为什么被折叠?



