//选择图片 requestCode 返回的标识 
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); //”Android.intent.action.GET_CONTENT” 
intent.setType(contentType); //查看类型 String IMAGE_UNSPECIFIED = “image/*”; 
Intent wrapperIntent = Intent.createChooser(intent, null); 
((Activity) context).startActivityForResult(wrapperIntent, requestCode);

//添加音频 
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
intent.setType(contentType); //String VIDEO_UNSPECIFIED = “video/*”; 
Intent wrapperIntent = Intent.createChooser(intent, null); 
((Activity) context).startActivityForResult(wrapperIntent, requestCode);

//拍摄视频 
int durationLimit = getVideoCaptureDurationLimit(); //SystemProperties.getInt(“ro.media.enc.lprof.duration”, 60); 
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); 
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); 
intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, sizeLimit); 
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, durationLimit); 
startActivityForResult(intent, REQUEST_CODE_TAKE_VIDEO);

//视频 
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
intent.setType(contentType); //String VIDEO_UNSPECIFIED = “video/*”; 
Intent wrapperIntent = Intent.createChooser(intent, null); 
((Activity) context).startActivityForResult(wrapperIntent, requestCode);

//录音 
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
intent.setType(ContentType.AUDIO_AMR); //String AUDIO_AMR = “audio/amr”; 
intent.setClassName(“com.android.soundrecorder”, 
“com.android.soundrecorder.SoundRecorder”); 
((Activity) context).startActivityForResult(intent, requestCode);

//拍照 REQUEST_CODE_TAKE_PICTURE 为返回的标识 
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //”android.media.action.IMAGE_CAPTURE”; 
intent.putExtra(MediaStore.EXTRA_OUTPUT, Mms.ScrapSpace.CONTENT_URI); // output,Uri.parse(“content://mms/scrapSpace”); 
startActivityForResult(intent, REQUEST_CODE_TAKE_PICTURE);

//跳转网页 
Intent i=new Intent(Intent.ACTION_VIEW, Uri.parse(“http://www.baidu.com/“)) ; 
startActivity(i);

更多相关文章

  1. 视频源
  2. 尚硅谷《全套Java、Android、HTML5前端视频》
  3. Android 使用意图录制视频
  4. android播放本地工程里的音乐和视频的方法
  5. 短视频带货源码,解决Dialog 不铺满屏幕问题
  6. android调用系统摄像头拍照图片和视频
  7. WebRTC实现音视频通话
  8. Android拓展系列(9)--Android视频录制screenrecord命令

随机推荐

  1. 深入了解Android图形管道-part2
  2. android Multiple markers at this line
  3. 整理的一些免费课程分享
  4. Android之Handler用法总结
  5. Android(java)学习笔记99:android的短信发送
  6. Android(安卓)Intents and Intent Filter
  7. 为android-support-v4.jar打包源码
  8. android获取安装的应用程序
  9. 2012 年最佳 Android(安卓)应用
  10. 软件工程预测一直都太不靠谱,如何做到不“