Cast actvitiy出错

时间:2015-06-12 06:31:58

标签: android xml

java.lang.**ClassCastException:** com....activity.FriendsFragment cannot be cast to android.app.Activity

我无法在清单xml文件中找出此错误。我该如何解决这个问题?

Android_manifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.user.pesfinal" >    
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/MyMaterialTheme" >
        <activity
            android:name=".activity.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>
        <activity android:name=".activity.HomeFragment" />    
        <!-- Friends Activity -->
        <activity android:name=".activity.FriendsFragment" />    
        <!-- Messages Activity -->
        <activity android:name=".activity.MessagesFragment" />    
    </application>    
</manifest>

1 个答案:

答案 0 :(得分:0)

您无需在FragmentsAndroidManifest课程中声明Activity