4
<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"



package="com.fitnesscircle.snapo">


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


<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">


    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>


<activity
    android:name="com.afollestad.materialcamera.CaptureActivity"
    android:label="@string/app_name"
    android:theme="@style/MaterialCamera.CaptureActivity" />
<activity
    android:name="com.afollestad.materialcamera.CaptureActivity2"
    android:theme="@style/MaterialCamera.CaptureActivity" />
<activity
    android:name="com.afollestad.materialcamera.MaterialCamera"
     />

即使我注册了它仍然说找不到明确的活动类。我是 android 编码的新手。有什么我需要改变的,所以我摆脱了这个 ActivityNotFoundException

找不到明确的活动类 {com.fitnesscircle.snapo/com.afollestad.materialcamera.CaptureActivity};您是否在 AndroidManifest.xml 中声明了此活动

请帮忙

4

1 回答 1

2

图书馆活动应在<application> </application>标签内注册

<?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.fitnesscircle.snapo">

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Register library Activities -->

        <activity
            android:name="com.afollestad.materialcamera.CaptureActivity"
            android:label="@string/app_name"
            android:theme="@style/MaterialCamera.CaptureActivity" />
        <activity
            android:name="com.afollestad.materialcamera.CaptureActivity2"
            android:theme="@style/MaterialCamera.CaptureActivity" />
        <activity
            android:name="com.afollestad.materialcamera.MaterialCamera"
             />

    </application>

</manifest>
于 2017-05-26T20:37:03.587 回答