android - Preference Menu on 10 inch tablet -
i trying figure out why layout of preference menu displayed in false way on 10' tablets when using in landscape mode. looks lines right of checkboxes left of them. can see here http://imageshack.us/photo/my-images/109/schnappschuss2013052109.png/
on 7' tablets, works expected do.
my menu looks that:
<?xml version="1.0" encoding="utf-8"?> <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android" > <preferencecategory android:title="@string/pref_message" android:key="pref_key_message_settings"> <checkboxpreference android:key="pref_key_add_timestamp" android:summary="@string/pref_summary_addtimestamp" android:title="@string/pref_addtimestamp" android:defaultvalue="true"/> <listpreference android:dependency="pref_key_add_timestamp" android:summary="@string/pref_summary_timestamp_option" android:key="pref_key_timestamp_option" android:title="@string/pref_timestampoption" android:dialogtitle="@string/pref_timestampoptiondialog" android:entries="@array/pref_timestamparray" android:entryvalues="@array/pref_timestampvalues" android:defaultvalue="time" /> <checkboxpreference android:key="pref_key_add_newline" android:summary="@string/pref_summary_addnewline" android:title="@string/pref_addnewline" android:defaultvalue="true"/> <listpreference android:dependency="pref_key_add_newline" android:key="pref_key_newline_option" android:summary="@string/pref_summary_newline_option" android:title="@string/pref_newlineoption" android:dialogtitle="@string/pref_newlineoptiondialog" android:entries="@array/pref_newlinearray" android:entryvalues="@array/pref_newlinevalues" android:defaultvalue="lf" /> <checkboxpreference android:key="pref_key_clear_text" android:summary="@string/pref_summary_cleartext" android:title="@string/pref_cleartext" android:defaultvalue="false"/> </preferencecategory> <preferencecategory android:title="@string/pref_storage" android:key="pref_key_storage_settings"> <edittextpreference android:key="pref_key_change_name" android:summary="@string/pref_summary_editfilename" android:title="@string/pref_editfilename" android:defaultvalue="history"/> <checkboxpreference android:key="pref_key_add_date" android:summary="@string/pref_summary_adddate" android:title="@string/pref_adddate" android:defaultvalue="true"/> <checkboxpreference android:key="pref_key_add_time" android:summary="@string/pref_summary_addtime" android:title="@string/pref_addtime" android:defaultvalue="true"/> <at.rtcmanager.confirmpreference android:key="pref_key_clear_history" android:summary="@string/pref_summary_clearhistory" android:title="@string/pref_clearhistory"/> </preferencecategory> <preferencecategory android:title="@string/pref_time" android:key="pref_key_time_settings"> <checkboxpreference android:key="pref_key_autosend_time" android:summary="@string/pref_summary_austosendtime" android:title="@string/pref_autosendtime" android:defaultvalue="false"/> <listpreference android:key="pref_key_mode_senttime" android:title="@string/pref_mode_senttime" android:summary="@string/pref_summary_mode_senttime" android:dialogtitle="@string/pref_modesenttimedialog" android:entries="@array/pref_senttimemodearray" android:entryvalues="@array/pref_senttimevalues" android:defaultvalue="10byte" /> </preferencecategory> <preferencecategory android:title="@string/pref_about" android:key="pref_key_settings_about"> <preference android:title="@string/prefs_about_app" > <intent android:action="aboutactivity"/> </preference> </preferencecategory> </preferencescreen>
and loded with:
@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // show button in action bar. getactionbar().setdisplayhomeasupenabled(true); // display fragment main content. getfragmentmanager().begintransaction() .replace(android.r.id.content, new settingsmenufragment()) .commit(); } public static class settingsmenufragment extends preferencefragment { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // load preferences xml resource addpreferencesfromresource(r.xml.app_prefs); } }
i had same problem. solution extend settingsactivity
usual activity
, not preferenceactivity
. settingsfragment
should extend preferencefragment
of course. helped me, hope solves issue too.
Comments
Post a Comment