Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

classnotfoundexception - android.content.ActivityNotFoundException: Unable to find explicit activity class

I get this error:

06-06 10:45:19.685: E/AndroidRuntime(554): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.Android.myApp/com.Android.myApp.Facebook.Example}; have you declared this activity in your AndroidManifest.xml?

But i have declared it in my manifest file. what might be the other reasons for such exception?

My manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.Android.myApp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="4" />

    <uses-feature android:name="android.hardware.camera" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Light" >

        <activity
            android:name=".SignUpActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SignInActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".HomeActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".selectCityActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".FeedListViewActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".SearchActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".IWantActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".DateActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ShareActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ShareProductActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".SharePriceActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ShareStoreActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ProfileActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ShowMapActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".ParticularEntryActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".MyLocationActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".MapMarkerActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".BarcodeActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".BarcodeResult"
            android:label="@string/app_name" />
        <activity
            android:name=".FeedbackActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".SplashActivity"
            android:label="@string/app_name" />
        <activity
            android:name=".Example"
            android:label="@string/app_name" />

        <uses-library android:name="com.google.android.maps" />
    </application>

</manifest>
Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You declared package name in the manifest as com.Android.myApp and Activity Name .Example.So android will search it from com.Android.myApp.Example. But your activity is residing in "com.Android.myApp/com.Android.myApp.Facebook.Example".So give the activity name as .Facebook.Example or full path as given below In the manifest

<activity
                android:name="com.Android.myApp.Facebook.Example">

</activity>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...