Duplicating items with android: -


trying setup app use material design:

<style name="apptheme" parent="android:theme.material.light.darkactionbar">         <!-- customize theme here. -->         <item name="colorprimary">@color/colorprimary</item>         <item name="colorprimarydark">@color/colorprimarydark</item>         <item name="coloraccent">@color/coloraccent</item>          <item name="android:colorprimary">@color/colorprimary</item>         <item name="android:colorprimarydark">@color/colorprimarydark</item>         <item name="android:coloraccent">@color/coloraccent</item> 
  • if items android: removed - colors not getting applied.
  • if items without android: removed - app crashes:

unable start activity componentinfo{com.foo.bar/com.foo.bar.mainactivity}: android.view.inflateexception: binary xml file line #9: error inflating class android.support.design.widget.tablayout

questions:

  • why have duplicate those?
  • should duplicate styles that?

edit:

the manifest file is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.foo.bar">      <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:supportsrtl="true"         android:theme="@style/apptheme">         <activity             android:name=".mainactivity"             android:screenorientation="portrait">             <intent-filter>                 <action android:name="android.intent.action.main"/>                  <category android:name="android.intent.category.launcher"/>             </intent-filter> 

edit2

activity_main.xml:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:id="@+id/activity_main"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">      <android.support.design.widget.tablayout         android:id="@+id/tl_periods"         android:layout_width="match_parent"         android:layout_height="wrap_content"         app:tabminwidth="100dp"         app:tabmode="scrollable"/> 

the theme of application not descendant of appcompat theme, whereas tablayout support packages.

you either have stick appcompat theme , views, or entirely support packages independent, otherwise such nasty issues rise.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -