MEDIA_TYPE_IMAGE not recognized

若如初见. 提交于 2019-12-04 03:21:08
Alejandro Moya

Try importing android.provider.MediaStore.Files.FileColumns and change MEDIA_TYPE_IMAGE to FileColumns.MEDIA_TYPE_IMAGE.

If you are using the sample code from Android developers blog be sure to check the section about saving media files, there you have the constants created to handle that.

Quession: MEDIA_TYPE_IMAGE not recognized

Anwser: Please add row in your class

public static final int MEDIA_TYPE_IMAGE = 1;

if you are trying the camera example from the android guide then read this
http://developer.android.com/guide/topics/media/camera.html#saving-media they have declared the method at the bottom of the documentation

Could be that you didn't give the good permissions in your Manifest (such as Camera access, external storage access, etc.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!