在我的Android应用程序中它崩溃并显示此消息,我在androidmanifest中添加了活动但是同样的错误!!
11-16 08:56:00.077: E/AndroidRuntime(622): FATAL EXCEPTION: main
11-16 08:56:00.077: E/AndroidRuntime(622): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.upnpexample/com.example.androidhive.CustomizedListView}; have you declared this activity in your AndroidManifest.xml?
EDITED 的AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.upnpexample"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"></uses- permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-sdk android:minSdkVersion="7"></uses-sdk>
<application android:icon="@drawable/appicon" android:label="@string/app_name" android:name=".UpnpControlApplication">
<activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
<activity android:name=".BrowseActivity"
android:label="@string/app_name">
</activity>
<activity android:name=".BrowseServerActivity" android:label="@string/app_name"></activity>
<service android:name=".BrowserUpnpService"></service>
<activity android:label="@string/list_player" android:name=".EPGview"/>
<activity android:label="@string/list_player" android:name=".Playsimplevideo"/>
<activity android:label="@string/list_player" android:name=".Streaming"/>
<activity android:label="@string/list_player" android:name=".LazyAdapter"/>
<activity android:label="@string/list_player" android:name=".CustomizedListView"/>
</application>
编辑2
我将它们放在同一个包中,现在它显示了这个错误
11-16 09:21:18.076: D/AndroidRuntime(710): Shutting down VM
11-16 09:21:18.076: W/dalvikvm(710): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-16 09:21:18.086: E/AndroidRuntime(710): FATAL EXCEPTION: main
11-16 09:21:18.086: E/AndroidRuntime(710): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.upnpexample/com.upnpexample.CustomizedListView}: java.lang.NullPointerException
我将它们放在同一个包中,现在它显示了这个错误
11-16 09:21:18.076: D/AndroidRuntime(710): Shutting down VM
11-16 09:21:18.076: W/dalvikvm(710): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-16 09:21:18.086: E/AndroidRuntime(710): FATAL EXCEPTION: main
11-16 09:21:18.086: E/AndroidRuntime(710): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.upnpexample/com.upnpexample.CustomizedListView}: java.lang.NullPointerException
答案 0 :(得分:0)
从以下位置更改CustomizedListView类中的包:
package com.example.androidhive;
为:
package com.upnpexample;