0

当我按下后退按钮并需要强制关闭时,我的应用程序意外停止。这是错误日志:

11-16 14:57:34.595: E/AndroidRuntime(4899): FATAL EXCEPTION: main
11-16 14:57:34.595: E/AndroidRuntime(4899): java.lang.IllegalStateException
11-16 14:57:34.595: E/AndroidRuntime(4899):     at android.media.MediaPlayer.getDuration(Native Method)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at com.example.musicshare.AndroidBuildingMusicPlayerActivity$1.run(AndroidBuildingMusicPlayerActivity.java:337)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at android.os.Handler.handleCallback(Handler.java:587)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at android.os.Looper.loop(Looper.java:123)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at android.app.ActivityThread.main(ActivityThread.java:3691)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at java.lang.reflect.Method.invokeNative(Native Method)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at java.lang.reflect.Method.invoke(Method.java:507)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
11-16 14:57:34.595: E/AndroidRuntime(4899):     at dalvik.system.NativeStart.main(Native Method)

可能是什么问题呢?

4

2 回答 2

1

查看您的日志:

11-12 14:21:20.080: E/AndroidRuntime(8843): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.musicshare/com.example.musicshare.ZoneActivity}; have you declared this activity in your AndroidManifest.xml?

您尚未在 Android 清单上声明 ZoneActivity .. 打开您的 Android 清单并添加:

<activity android:name=".ZoneActivity" />
于 2012-11-12T07:40:13.763 回答
0

这就是您感兴趣的信息:

Unable to find explicit activity class com.example.musicshare/com.example.musicshare.ZoneActivity}; have you declared this activity in your AndroidManifest.xml?

您的清单中定义的活动似乎在您的代码中不存在。

于 2012-11-12T07:40:15.000 回答