Trying to add a fragment from another library - android

819 views Asked by At

I am trying to add the following library:

https://github.com/infospace/android_oauth2_webview

to my project but I am getting an error:

Class is not a View android.support.v4.app.Fragment

(I also updated the v4 support libraries for the library and my project) Here's my main page on project:

<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"
     />

</RelativeLayout>

What am I doing wrong?

1

There are 1 answers

6
corsair992 On

You need to use a FragmentActivity instead of Activity if you are including Fragments from the support library.