android的intent打开系统程序
2016-04-27 14:27
525 查看
打开设置主界面
Intent intent = new Intent(Android.provider.Settings.ACTION_SETTINGS); //系统设置
startActivityForResult( intent , 0);
打开网络设置界面(其他设置中的界面同理)
Intent intent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);//WIFI设置
startActivity(intent);
new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS);//管理应用程序界面
new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);//打开蓝牙设置
或者用以下方法(3.0以前的版本可以用此方法)
Intent intent = new Intent("/");
ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings");
intent.setComponent(cm);
intent.setAction("android.intent.action.VIEW");
startActivityForResult( intent , 0);
打开壁纸设置
Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(intent);
打开拨号界面
Intent intent = new Intent(Intent.ACTION_DIAL);
startActivity(intent);
打开联系人界面
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/contact");
startActivity(intent);
打开通话记录
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/calls");
startActivity(intent);
打开短信列表界面
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
打开相册和视频
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/image");//图片列表
intent.setType("vnd.android.cursor.dir/video");//视频列表
startActivity(intent);
打开mp3播放器
Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");
startActivity(intent);
打开照相机
Intent intent = new Intent("android.media.action.STILL_IMAGE_CAMERA");
startActivity(intent);
打开录音
选择一张照片或一个mp3文件或一个mp4文件
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//图片
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//音频
intent.setType("audio/*");
startActivityForResult(Intent.createChooser(intent, "Select music"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//视频
intent.setType("video/*");
startActivityForResult(Intent.createChooser(intent, "Select movie"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//录音
intent.setClassName("com.android.soundrecorder", "com.android.soundrecorder.SoundRecorder");
intent.setType("audio/*");
startActivityForResult(Intent.createChooser(intent, "Select movie"),1);
Intent intent = new Intent(Android.provider.Settings.ACTION_SETTINGS); //系统设置
startActivityForResult( intent , 0);
打开网络设置界面(其他设置中的界面同理)
Intent intent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);//WIFI设置
startActivity(intent);
new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS);//管理应用程序界面
new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);//打开蓝牙设置
或者用以下方法(3.0以前的版本可以用此方法)
Intent intent = new Intent("/");
ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings");
intent.setComponent(cm);
intent.setAction("android.intent.action.VIEW");
startActivityForResult( intent , 0);
打开壁纸设置
Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(intent);
打开拨号界面
Intent intent = new Intent(Intent.ACTION_DIAL);
startActivity(intent);
打开联系人界面
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/contact");
startActivity(intent);
打开通话记录
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/calls");
startActivity(intent);
打开短信列表界面
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
打开相册和视频
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.dir/image");//图片列表
intent.setType("vnd.android.cursor.dir/video");//视频列表
startActivity(intent);
打开mp3播放器
Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");
startActivity(intent);
打开照相机
Intent intent = new Intent("android.media.action.STILL_IMAGE_CAMERA");
startActivity(intent);
打开录音
选择一张照片或一个mp3文件或一个mp4文件
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//图片
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//音频
intent.setType("audio/*");
startActivityForResult(Intent.createChooser(intent, "Select music"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//视频
intent.setType("video/*");
startActivityForResult(Intent.createChooser(intent, "Select movie"),1);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);//录音
intent.setClassName("com.android.soundrecorder", "com.android.soundrecorder.SoundRecorder");
intent.setType("audio/*");
startActivityForResult(Intent.createChooser(intent, "Select movie"),1);
相关文章推荐
- Linxu下Android Studio不能输入中文的解决办法
- Android RxJava使用介绍(一) Hello World
- [Anim]安卓页面交互淡入淡出Animation
- android studio中android serviced的详解
- Android 3D画廊采用Gallery实现无限循环、自动轮播
- Android 内存分析
- Android——shape和selector和layer-list的(详细说明 转)
- Android关机流程源码分析
- android相机对焦
- Android 操作SQLite基本用法
- Android的多媒体管理库Glide的基本使用示例
- Android——FilenameFilter总结(转)
- Android学习 游戏开发之打地鼠(四,游戏结束和数据存储)
- 深入浅出 - Android系统移植与平台开发(五)- 编译Android源码(转)
- Android蓝牙4.0
- android GCM(消息推送)面向国内开发的话基本不用看了
- 自定义ViewGroup初步
- Android知识梳理之自定义ViewGroup
- android的四大存储之一 SharedPreferences
- Android SQLite的连接和基本操作