android-cn / android-discuss

Android 问题交流讨论坛, 微信公众号:codekk, 网站:
https://github.com/android-cn/android-discuss/issues
Apache License 2.0
4.08k stars 535 forks source link

Flyme5 调用系统相机录像 #455

Open jinsen47 opened 8 years ago

jinsen47 commented 8 years ago

请问如何调用Flyme5的系统相机进行录像? intent传进去App不报任何exception直接闪退 然而同样的代码在Miui和Emui都是好的。。。 附上Intent相关代码:

Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempFile));
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
startActivityForResult(intent, REQUEST_TAKE_VIDEO);
Demon-GD commented 8 years ago

可以看一下Flyme5的源码,相机的录像Action定义。可以从手机里通过ADB导出系统相机的源码。然后反编译一下。其他不重要你看下AnroidManifest.xml 希望能帮到你~