【问题标题】:Camera android API 13相机安卓 API 13
【发布时间】:2015-04-29 01:00:53
【问题描述】:

我想检查相机参数,我还有旧手机,我正在使用库 android.hardware.camera。我这里有一个错误,我在其他网站上没有找到任何解决方案:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.arkadio.cameralight/com.example.arkadio.cameralight Binary XML file line #16: Error inflating class uses-permission"

我的 XML 在这里

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:paddingTop="@dimen/activity_vertical_margin"
            android:paddingBottom="@dimen/activity_vertical_margin"
            tools:context=".MainActivity">

<TextView
    android:text="@string/hello_world"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
</RelativeLayout>

和我的代码:

http://pastebin.com/8H4YH2iM

谢谢!

【问题讨论】:

    标签: android camera


    【解决方案1】:

    uses-permission 属于 AndroidManifest.xml,不属于布局资源 XML 文件。

    【讨论】:

    • 哇哇非常感谢!
    猜你喜欢
    • 2011-11-24
    • 1970-01-01
    • 2015-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-26
    • 2011-05-28
    • 1970-01-01
    相关资源
    最近更新 更多