android - InflateException Binary XML file line #2: Error inflating class fragment with ScrollViews -
i have tried every suggestion out there problem, unable solve problem.
so getting exception binary xml file line #2: error inflating class fragment
. seems me pretty obvious on line #2, scrollview, inflating of view failing.
my code explanation of goal. using accountauthenticators check whether account exists desired account type, far good. if there no account in system create new explicit intent start loginactivity
hosts loginfragment
, whereby exception.
by similar problems on stackoverflow have read far, activity supports fragments (i use actionbaractivity
extends fragmentactivity
). -> public class loginactivity extends actionbaractivity
-> import android.support.v7.app.actionbaractivity;
.
my loginactivity layout file
<?xml version="1.0" encoding="utf-8"?> <fragment android:id="@+id/fragment_login" 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" android:name="com.anuragajwani.whomsapp.activity.loginfragment" tools:context="com.anuragajwani.whomsapp.activity.loginfragment" />
i did try changing android:name
class
suggested, pointed out should work regardless. have other fragments in system working fine using android:name
.
now here believe problem lies.
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true"> <relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <!-- header --> <linearlayout android:id="@+id/header" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingtop="5dip" android:paddingbottom="5dip"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="10dip" android:layout_marginstart="10dip" android:contentdescription="brightpearl logo"/> </linearlayout> <!-- end header --> <!-- login form --> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dip" android:layout_below="@+id/header" android:orientation="vertical"> <!-- datacenter --> <spinner android:id="@+id/data_centre_spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:entries="@array/data_centres" android:prompt="@string/data_centre_prompt"/> <!-- account label --> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="account"/> <edittext android:id="@+id/accountaccessaccount" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="5dip" android:layout_marginbottom="20dip" android:singleline="true"/> <!-- username label --> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="email"/> <edittext android:id="@+id/accountaccessemail" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="5dip" android:layout_marginbottom="20dip" android:singleline="true"/> <!-- password label --> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="password"/> <edittext android:id="@+id/accountaccesspassword" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="5dip" android:singleline="true" android:password="true"/> <!-- login button --> <button android:id="@+id/btnlogin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="5dip" android:text="login"/> <!-- future link prodeo website --> <!--<textview--> <!--android:layout_width="fill_parent"--> <!--android:layout_height="wrap_content"--> <!--android:layout_margintop="40dip"--> <!--android:layout_marginbottom="40dip"--> <!--android:text="create new prodeo account"/>--> </linearlayout> <!-- login form end --> <!-- footer start add brightpearl partner logo --> <!--<linearlayout--> <!--android:layout_width="fill_parent"--> <!--android:layout_height="wrap_content">--> <!-- --> <!--</linearlayout>--> <!-- footer end --> </relativelayout> </android.support.v4.widget.scrollview>
line #2 i'm guessing has scrollview not playing nice previous versions. changed scrollview
android.support.v4.widget.scrollview
sake of trying, no results.
my loginfragment ->
import android.support.v4.app.fragment; public class loginfragment extends fragment { public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragment_login, container, false); butterknife.inject(this, view); return view; } }
Comments
Post a Comment