Nithin.P Molethu
Nithin.P Molethu

Reputation: 109

Register library activity in manifest

<?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"
     />

Even though i register its still says cant find explicit activity class. am new to android coding. is anything i need to change so i get rid of this ActivityNotFoundException

Unable to find explicit activity class {com.fitnesscircle.snapo/com.afollestad.materialcamera.CaptureActivity}; have you declared this activity in your AndroidManifest.xml

please help

Upvotes: 5

Views: 3307

Answers (1)

Ramana V V K
Ramana V V K

Reputation: 1251

The library activities should be registered within <application> </application> tag

<?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>

Upvotes: 2

Related Questions