【问题标题】:Android Activity is there in android manifest but it is still not foundAndroid Activity 存在于 android manifest 中,但仍未找到
【发布时间】:2016-01-29 15:29:26
【问题描述】:

我已经尝试了几乎所有与我在此处发布的问题相关的问题。 我正在关注来自的教程 http://techiedreams.com/android-simple-rss-reader/ 我遇到了这个例外:

Activity Not Found Exception

这是清单文件代码:

    <activity
        android:name=".SplashActivity"
        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=".ListActivity"/>
    <activity android:name=".DetailActivity"/>

这是代码:

私有类 AsyncLoadXMLFeed 扩展 AsyncTask {

    @Override
    protected Void doInBackground(Void... Params) {

        // Obtain feed
        DOMParser myParser = new DOMParser();
        feed = myParser.parseXml(RSSFEEDURL);
        return null;

    }

    @Override
    protected void onPostExecute(Void result) {
        super.onPostExecute(result);

        Bundle bundle = new Bundle();
        bundle.putSerializable("feed", feed);

        // launch List activity
        Intent intent = new Intent(SplashActivity.this, ListActivity.class);
        intent.putExtras(bundle);
        startActivity(intent);

        // kill this activity
        finish();
    }

}

请注意为什么会引发此异常。

【问题讨论】:

  • 使用 import com.example.sophiaajaz.rssapp. ListActivity 而不是 android.app. ListActivity
  • 我做了这个解决方案,但仍然没有工作@ρяσѕρєяK

标签: android android-intent android-activity android-manifest


【解决方案1】:

ListActivity 也是一个 Android 类。您可以在日志中看到它正在启动的 Android 变体。 在文件的顶部,您可能会看到import android.app.ListActivity,而它应该是import your.package.ListActivity

【讨论】:

  • 感谢@0xDEADC0DE 的帮助。我实际上导入了 android.app.ListActivity !
猜你喜欢
  • 1970-01-01
  • 2014-05-31
  • 2021-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-27
  • 1970-01-01
  • 2021-09-24
相关资源
最近更新 更多