c# - Must specify preferenceTheme in theme occurred even after including it -


i have mainactivity.cs inflates fragment settingsfragment.cs test.axml. preferences definition inside preference_screen.xml. i'm gettings error while deplyoing:

unhandled exception: java.lang.illegalstateexception: must specify preferencetheme in theme occurred 

so obvious reasons there's no preferencetheme specified in styles.xml. however, after including in styles-file, program still stops inside oncreate()-method same error.

<style name="apptheme" parent="@style/theme.appcompat.light">   <item name="preferencetheme">@style/preferencethemeoverlay</item> </style> 

here's other files:

settingsfragment.cs:

using android.os; using android.views; using android.widget; using supportfragment = android.support.v4.app.fragment; using preferencetest.fragments; using android.graphics; using system.collections.generic; using android.support.v4.app; using android.support.design.widget; using system; using android.support.v7.preferences;  namespace preferencetest.fragments {     public class settingsfragment : preferencefragmentcompat      {          public override void oncreate(bundle savedinstancestate)         {             base.oncreate(savedinstancestate);          }          public override void oncreatepreferences(bundle savedinstancestate, string rootkey)         {             addpreferencesfromresource(resource.layout.preference_screen);         }          public override view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate)         {             // return our custom view fragment             view view = inflater.inflate(resource.layout.test, container, false);               return view;         }        } } 

test.axml

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"             android:layout_width="match_parent"             android:layout_height="match_parent"             android:id="@+id/home_layout">  </relativelayout> 

preference_screen.xml

<preferencescreen xmlns:android="http://schemas.android.com/apk/res/android">    <preferencecategory       android:key="setting_title_title_category"       android:title="title options">      <checkboxpreference         android:id="@+id/setting_title_show_id"         android:key="setting_title_show"         android:title="show main title"         android:summary="show/hide mainpage title" />      <edittextpreference         android:key="setting_title_text"         android:title="set main title"         android:summary="change mainpage title"         android:dialogtitle="change title"         android:dialogmessage="change title please..."/>    </preferencecategory> </preferencescreen> 

an overview of nuget packages:

  • xamarin.android.support.animated.vector.drawable {23.2.1}
  • xamarin.android.support.design {23.2.1}
  • xamarin.android.support.v14.preference {23.2.1}
  • xamarin.android.support.v4 {23.2.1}
  • xamarin.android.support.v7.appcompat {23.2.1}
  • xamarin.android.support.v7.preference {23.2.1}
  • xamarin.android.support.v7.recyclerview {23.2.1}
  • xamarin.android.support.vector.drawable {23.2.1}

any ideas on why? highly appreciate input on why might crashing.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -