Question

I am relatively new to Android development; I have an application that obtains rss feeds from websites. When I open the list of articles presented on a listview, and try opening the specific article, the application crashes.

Could someone please tell me how I can fix this?

I have put ACRA in the application, and have the crash reports sent via email. They are entered below. Help would be much appreciated!

Following is the stacktrace obtained:

    USER_COMMENT=null
ANDROID_VERSION=4.1.2
APP_VERSION_NAME=1.0
BRAND=samsung
PHONE_MODEL=GT-N8000
CUSTOM_DATA=
STACK_TRACE=android.content.ActivityNotFoundException: Unable to find explicit activity class {com.j.infographx/com.j.infographx.DisPlayWebPageActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1556)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)
at android.app.Activity.startActivityForResult(Activity.java:3428)
at android.app.Activity.startActivityForResult(Activity.java:3389)
at android.app.Activity.startActivity(Activity.java:3599)
at android.app.Activity.startActivity(Activity.java:3567)
at com.j.infographx.ListRSSItemsActivity$1.onItemClick(ListRSSItemsActivity.java:79)
at android.widget.AdapterView.performItemClick(AdapterView.java:301)
at android.widget.AbsListView.performItemClick(AbsListView.java:1287)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3078)
at android.widget.AbsListView$1.run(AbsListView.java:4161)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)

Android Manifest:

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <!-- Internet Permissions -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 
        android:name="MyApplication">
        <activity
            android:configChanges="keyboardHidden|orientation"
            android:name="com.j.infographx.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <!-- Add New Site Activity -->
        <activity android:name=".AddNewSiteActivity"/>

        <!-- List rss items Activity -->
        <activity android:name=".ListRSSItemsActivity"
            android:configChanges="keyboardHidden|orientation"/>

        <!-- Display webpage Activity -->
        <activity android:name=".DisplayWebPageActivity"
            android:theme="@android:style/Theme.NoTitleBar"
            android:configChanges="keyboardHidden|orientation"/> 
    </application>

</manifest>
Was it helpful?

Solution

You have to declare the activity in you manifest. like this:

 <activity
        android:name="com.j.infographx.DisPlayWebPageActivity">
 </activity>

OTHER TIPS

have you declared this activity in your AndroidManifest.xml?

=> Logcat output says you haven't declared activity in AndroidManifest.xml file. You might have made mistake in name.

ActivityNotFoundException: it means you should register you Activity in Androidmanifest.xml

like :

<activity
        android:name="com.example.MainActivity"
        android:label="@string/app_name" >
    </activity>

Try:

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

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".MainActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".DisPlayWebPageActivity" >
        </activity>
    </application>

</manifest>

Check this example for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top