html video control is not working in codenameone app for android

有些话、适合烂在心里 提交于 2019-12-06 16:06:52

You need to prompt for native permissions in Android 6+. Adding them to the XML only works for older versions of Android. This is normally automatic if you use a camera API in Codename One but won't work for the case of HTML because we can't tell that you will try to access the camera.

You can create a native interface something like:

public boolean promptCameraPermission();

You can leave it unimplemented in all other platforms as it isn't needed, then when supported is true you can just invoke it to ask for permission.

return checkForPermission(Manifest.permission.CAMERA, "This is required to take a picture");

Make sure to import com.codename1.impl.android.AndroidImplementation;

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