package com.stackallocated.imageupload;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;

public class SettingsActivity extends PreferenceActivity {
    public static final String KEY_UPLOAD_URL = "pref_server_upload_url";
    public static final String KEY_UPLOAD_USERNAME = "pref_server_auth_username";
    public static final String KEY_UPLOAD_PASSWORD = "pref_server_auth_password";

    class SettingsFragment extends PreferenceFragment {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.preferences);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getFragmentManager().beginTransaction()
            .replace(android.R.id.content, new SettingsFragment())
            .commit();
    }
}

package com.stackallocated.imageupload;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;

public class SettingsActivity extends PreferenceActivity {
    public static final String KEY_UPLOAD_URL = "pref_server_upload_url";
    public static final String KEY_UPLOAD_USERNAME = "pref_server_auth_username";
    public static final String KEY_UPLOAD_PASSWORD = "pref_server_auth_password";

    public static class SettingsFragment extends PreferenceFragment {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.preferences);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getFragmentManager().beginTransaction()
            .replace(android.R.id.content, new SettingsFragment())
            .commit();
    }
}

Fix SettingsFragment class visibility for reinstantiation