// Path: app/src/main/java/net/sourceforge/servestream/preference/UserPreferences.java
// public class UserPreferences implements
// 		SharedPreferences.OnSharedPreferenceChangeListener {
// 	private static UserPreferences instance;
// 	private final Context mContext;
// 
// 	// Preferences
// 	private int mTheme;
// 
// 	private UserPreferences(Context context) {
// 		mContext = context;
// 		loadPreferences();
// 	}
// 
// 	/**
// 	 * Sets up the UserPreferences class.
// 	 *
// 	 * @throws IllegalArgumentException
// 	 *             if context is null
// 	 * */
// 	public static void createInstance(Context context) {
// 		if (context == null)
// 			throw new IllegalArgumentException("Context must not be null");
// 		instance = new UserPreferences(context);
// 
// 		PreferenceManager.getDefaultSharedPreferences(context)
// 				.registerOnSharedPreferenceChangeListener(instance);
// 
// 	}
// 
// 	private void loadPreferences() {
// 		SharedPreferences sp = PreferenceManager
// 				.getDefaultSharedPreferences(mContext);
// 		//mTheme = readThemeValue(sp.getString(PreferenceConstants.THEME, "0"));
// 		mTheme = R.style.Theme_ServeStream_DarkActionBar;;
// 	}
// 
// 	private int readThemeValue(String valueFromPrefs) {
// 		switch (Integer.parseInt(valueFromPrefs)) {
// 		case 0:
// 			return R.style.Theme_ServeStream_DarkActionBar;
// 		case 1:
// 			return R.style.Theme_ServeStream_Dark;
// 		default:
// 			return R.style.Theme_ServeStream_DarkActionBar;
// 		}
// 	}
// 
// 	private static void instanceAvailable() {
// 		if (instance == null) {
// 			throw new IllegalStateException(
// 					"UserPreferences was used before being set up");
// 		}
// 	}
// 
// 	public static int getTheme() {
// 		instanceAvailable();
// 		return instance.mTheme;
// 	}
// 
// 	@Override
// 	public void onSharedPreferenceChanged(SharedPreferences sp, String key) {
// 		if (key.equals(PreferenceConstants.THEME)) {
// 			mTheme = readThemeValue(sp.getString(PreferenceConstants.THEME, ""));
// 		}
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import net.sourceforge.servestream.R;
import net.sourceforge.servestream.adapter.SearchAdapter;
import net.sourceforge.servestream.bean.UriBean;
import net.sourceforge.servestream.preference.UserPreferences;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
package net.sourceforge.servestream.activity;



public class SearchableActivity extends ActionBarActivity {

	private SearchAdapter mAdapter;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
// Path: app/src/main/java/net/sourceforge/servestream/preference/UserPreferences.java
// public class UserPreferences implements
// 		SharedPreferences.OnSharedPreferenceChangeListener {
// 	private static UserPreferences instance;
// 	private final Context mContext;
// 
// 	// Preferences
// 	private int mTheme;
// 
// 	private UserPreferences(Context context) {
// 		mContext = context;
// 		loadPreferences();
// 	}
// 
// 	/**
// 	 * Sets up the UserPreferences class.
// 	 *
// 	 * @throws IllegalArgumentException
// 	 *             if context is null
// 	 * */
// 	public static void createInstance(Context context) {
// 		if (context == null)
// 			throw new IllegalArgumentException("Context must not be null");
// 		instance = new UserPreferences(context);
// 
// 		PreferenceManager.getDefaultSharedPreferences(context)
// 				.registerOnSharedPreferenceChangeListener(instance);
// 
// 	}
// 
// 	private void loadPreferences() {
// 		SharedPreferences sp = PreferenceManager
// 				.getDefaultSharedPreferences(mContext);
// 		//mTheme = readThemeValue(sp.getString(PreferenceConstants.THEME, "0"));
// 		mTheme = R.style.Theme_ServeStream_DarkActionBar;;
// 	}
// 
// 	private int readThemeValue(String valueFromPrefs) {
// 		switch (Integer.parseInt(valueFromPrefs)) {
// 		case 0:
// 			return R.style.Theme_ServeStream_DarkActionBar;
// 		case 1:
// 			return R.style.Theme_ServeStream_Dark;
// 		default:
// 			return R.style.Theme_ServeStream_DarkActionBar;
// 		}
// 	}
// 
// 	private static void instanceAvailable() {
// 		if (instance == null) {
// 			throw new IllegalStateException(
// 					"UserPreferences was used before being set up");
// 		}
// 	}
// 
// 	public static int getTheme() {
// 		instanceAvailable();
// 		return instance.mTheme;
// 	}
// 
// 	@Override
// 	public void onSharedPreferenceChanged(SharedPreferences sp, String key) {
// 		if (key.equals(PreferenceConstants.THEME)) {
// 			mTheme = readThemeValue(sp.getString(PreferenceConstants.THEME, ""));
// 		}
// 	}
// }


// Path: app/src/main/java/net/sourceforge/servestream/activity/SearchableActivity.java
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import net.sourceforge.servestream.R;
import net.sourceforge.servestream.adapter.SearchAdapter;
import net.sourceforge.servestream.bean.UriBean;
import net.sourceforge.servestream.preference.UserPreferences;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

package net.sourceforge.servestream.activity;



public class SearchableActivity extends ActionBarActivity {

	private SearchAdapter mAdapter;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
        setTheme(UserPreferences.getTheme());