正在尝试添加来自另一个库的片段-android

正在尝试添加来自另一个库的片段-android,android,fragment,feedly,Android,Fragment,Feedly,我正在尝试添加以下库: 我的项目,但我得到一个错误: Class is not a View android.support.v4.app.Fragment (我还更新了该库和我的项目的v4支持库) 这是我关于项目的主页: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:lay

我正在尝试添加以下库:

我的项目,但我得到一个错误:

Class is not a View android.support.v4.app.Fragment
(我还更新了该库和我的项目的v4支持库) 这是我关于项目的主页:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

tools:context=".MainActivity" >
<android.support.v4.app.Fragment
    android:id="@+id/webview"
    android:name="com.infospace.android.oauth2.AuthenticationFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     />

我做错了什么

提前感谢,
Din.

如果您从支持库中包含
片段,则需要使用
片段活动
而不是
活动

起初是片段给了我:“错误膨胀类片段”,直到我看到任何其他想法为止。@dinbrca:对不起,我的答案是错误的;我看到这个答案在一个类似的问题上被接受,并不假思索地复制了它。您是否正在使用此布局膨胀的
FragmentActivity
?否。。库使用Fragment而不是FragmentActivity。虽然-我试图手动将其从Fragment转换为FragmentActivity,但出现了另一个错误。@dinbrca:如果您正在使用支持库中的
Fragment
s,则需要将
Activity
s转换为
FragmentActivity
s。我已经尝试了从FragmentActivity转换为FragmentActivity。。它告诉我“类不是android.support.v4.app.FragmentActivity的视图”