0

我对 Android 开发比较陌生;我有一个从网站获取 RSS 提要的应用程序。当我打开列表视图上显示的文章列表并尝试打开特定文章时,应用程序崩溃。

有人可以告诉我如何解决这个问题吗?

我已将 ACRA 放入应用程序,并通过电子邮件发送崩溃报告。它们在下面输入。帮助将不胜感激!

以下是获得的堆栈跟踪:

    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)

安卓清单:

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

4 回答 4

2

您必须在清单中声明活动。像这样:

 <activity
        android:name="com.j.infographx.DisPlayWebPageActivity">
 </activity>
于 2013-09-17T09:31:30.343 回答
1

您是否在 AndroidManifest.xml 中声明了此活动?

=> Logcat 输出表明您尚未在 AndroidManifest.xml 文件中声明活动。您可能在名称上犯了错误。

于 2013-09-17T09:32:01.730 回答
1

ActivityNotFoundException: 这意味着你应该在 Androidmanifest.xml 中注册你的 Activity

喜欢 :

<activity
        android:name="com.example.MainActivity"
        android:label="@string/app_name" >
    </activity>
于 2013-09-17T09:40:02.623 回答
0

尝试:

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

查看示例以获取更多详细信息。

于 2013-09-17T09:37:55.020 回答