android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.GridLayout -


this error comes when running app.

java.lang.runtimeexception: unable start activity componentinfo : android.view.inflateexception: binary xml file line #1: error inflating class android.widget.gridlayout

<gridlayout 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:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     android:paddingbottom="@dimen/activity_vertical_margin"     tools:context="com.example.ankur.shop.homeactivity"     android:background="@drawable/gradient7">      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="welcome"         android:id="@+id/welcometext"         android:layout_row="0"         android:layout_column="0" />      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:id="@+id/nametext"         android:layout_row="0"         android:layout_column="1" />      <viewflipper         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:id="@+id/viewflipper"         android:layout_row="1"         android:layout_column="0"         android:inanimation="@color/abc_color_highlight_material"         android:flipinterval="@integer/abc_config_activitydefaultdur">          <imageview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/picture1" />      <imageview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/picture2" />      <imageview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/picture3" />      <imageview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/picture4" />      <imageview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/picture5" />      </viewflipper> </gridlayout> 

as documentation, must aware app widget layouts based on remoteviews, not support every kind of layout or view widget.

may gridview not allowed trying use that. remoteviews object can support following layout classes:

  • framelayout
  • linearlayout
  • relativelayout
  • gridlayout

see more @ here

solution

  • try using layout type in remote view.
  • you using prior 4.2. may not support, review too.

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

Redirect to a HTTPS version using .htaccess -