Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:11:11+00:00 2026-06-17T19:11:11+00:00

Im having a FC issue on my preference setup. I looked on the web

  • 0

Im having a FC issue on my preference setup. I looked on the web for some preference examples to work for both API lower and higher than 3.0. So I got 2 xml preference files just like the tutorial. Then I used the same method to check and call each xml preference file and now getting FC. I also had to manually changed min API to 11 from 7 to run sometimes which defeat the purpose. Both xmls are identical. Any insight?

Prefs Class

package com.armstrong.yi.android.app;

import java.util.List;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import com.armstrong.yi.android.app.R;

public class Prefs extends PreferenceActivity {

    final static String ACTION_PREFS_ONE = "com.armstrong.yi.android.app.PREFS";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        String action = getIntent().getAction();
        if (action != null && action.equals(ACTION_PREFS_ONE)) {
            addPreferencesFromResource(R.xml.prefs);
        }

        else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            // Load the legacy preferences headers
            addPreferencesFromResource(R.xml.prefs_legacy);
        }

    }

    public void onBuildHeaders(List<Header> target) {
        loadHeadersFromResource(R.xml.prefs, target);
    }
}

prefs xml

    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

<EditTextPreference
    android:key="name"
    android:summary="Enter Your Name"
    android:title="EditText" />

<CheckBoxPreference
    android:defaultValue="true"
    android:key="checkbox"
    android:summary="for the splash screen"
    android:title="Music" />

<ListPreference
    android:entries="@array/list"
    android:key="list"
    android:summary="This is a list to choose from"
    android:title="list"
    android:entryValues="@array/lValues" />

    </PreferenceScreen>

Manifest

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.armstrong.yi.android.app"
android:versionCode="2"
android:versionName="2.7.9" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.SET_WALLPAPER" />

<application
    android:name="GlobalVariables"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.armstrong.yi.android.app.NumCounter"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="com.armstrong.yi.android.app.MAINACTIVITY" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Menu"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="com.armstrong.yi.android.app.MENU" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TextPlay"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".Email"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".DailyDataEntry"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".WeeklyDataEntry"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".Camera"
        android:label="@string/title_activity_main"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".InitialDataEntry"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".FinalDataEntry"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".Rankings"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".Data"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".OpenedClass"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".AboutUs"
        android:label="@string/title_activity_main"
        android:theme="@android:style/Theme.Dialog" >
        <intent-filter>
            <action android:name="com.armstrong.yi.android.app.ABOUT" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.armstrong.yi.android.app.GlobalVariables"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".Prefs"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="com.armstrong.yi.android.app.PREFS" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

    </manifest>

Error log

01-23 17:44:40.877: W/dalvikvm(2095): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
01-23 17:44:40.957: E/AndroidRuntime(2095): FATAL EXCEPTION: main
01-23 17:44:40.957: E/AndroidRuntime(2095): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.armstrong.yi.android.app/com.armstrong.yi.android.app.Prefs}: java.lang.RuntimeException: XML document must start with <preference-headers> tag; foundPreferenceScreen at Binary XML file line #2
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-23 17:44:40.957: E/AndroidRuntime(2095):     at android.os.Looper.loop(Looper.java:137)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:11:12+00:00Added an answer on June 17, 2026 at 7:11 pm

    You need to add another file, such as pref_headers.xml since Android can also use headers to determine how to show the preferences. See the documentation.

    In it, put the name of your Fragment

    <preference-headers xmlns:android="http://schemas.android.com/apk/res/android" >
    
        <header
            android:fragment="com.myapp.MyFragment"
            android:title="My header" />
    
    </preference-headers>
    

    Add more header tags for other fragments.

    Then change

    loadHeadersFromResource(R.xml.prefs, target);
    

    to

    loadHeadersFromResource(R.xml.pref_headers.xml, target);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an extremely strange issue with some of my functions in a
For some reason I have having an issue compiling a shared object that uses
I'm having some issues understanding how to reference new browser windows after opening them.
Having issue with slider navigation. Works perfectly fine when there are no other unordered
I having issue that content assistant / intellisense is working in methods such as
Hi guys I am having issue I have this query: SELECT * FROM useraccount
i am having issue with loading my selector via a jquery ajax load call
Just started mongo and started having issue with querying already. i have a collection
Having an issue with a salesforce login on our site. When the customer fills
Having an issue resizing the #main_wrap on: http://www.coffeeproteindrink.com/method-athlete/ #main_wrap { min-height: 100%; background: url(images/content_back.png)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.