转载请标明出处。

打开相册和视频


跳转到图片与视频显示

intent = new Intent(Intent.ACTION_VIEW);//图片和视频intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);//等价于intent.setData(Uri.parse("content://media/external/images/media"));//由log输出可以看到: MediaStore.Images.Media.EXTERNAL_CONTENT_URI 的值就是 "content://media/external/images/media"

跳转到只有图片显示

intent = new Intent(Intent.ACTION_VIEW);//跳转到视频intent.setType("vnd.android.cursor.dir/image");


跳转到视频

intent = new Intent(Intent.ACTION_VIEW);//跳转到视频intent.setType("vnd.android.cursor.dir/video");

以下下是复制网上的:http://blog.csdn.net/xubright/article/details/8704873

选择一张照片或一个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);


打开mp3播放器

Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");startActivity(intent);


打开照相机

Intent intent = new Intent("android.media.action.STILL_IMAGE_CAMERA");startActivity(intent);



更多相关文章

  1. Android聊天软件开发(基于网易云IM即时通讯)——发送图片消息(五)
  2. 使用http协议获取网络图片
  3. Android图片代码换色,背景换色
  4. Android在listview添加checkbox实现原理与代码
  5. android 多余文字显示省略号
  6. PC安卓模拟器PANIC: Could not open:C:\Documents and Settings
  7. 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveI
  8. android 将图片内容解析成字节数组,将字节数组转换为ImageView可
  9. android 自动生成html报表图片

随机推荐

  1. android binder机制及其源码解析之第二节
  2. Android 8.0 dlopen failed 问题
  3. Android(安卓)utc时间
  4. Android系统版本号对应的代号以及API等级
  5. android 横坚屏
  6. 【Android】监听应用程序安装和卸载
  7. 关于androidSDK更新缓慢的解决方法(以W7为
  8. Android 8.0 跳转通知设置界面适配
  9. Android之JNI:Android(安卓)Studio使用Gra
  10. android发编译