// Path: src/main/java/com/axelby/podax/Storage.java
// public class Storage {
// 	public static File getExternalStorageDirectory(Context context) {
// 		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
// 		String storageCard = prefs.getString("storageCard", "/storage/sdcard0");
// 		if (new File(storageCard).exists())
// 			return new File(storageCard);
// 		return Environment.getExternalStorageDirectory();
// 	}
// }


import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import com.axelby.podax.R;
import com.axelby.podax.Storage;
import java.io.File;
import java.util.ArrayList;

		setPreferenceScreen(screen);
	}

	private CharSequence getEntryText(ListPreference listPreference, String value) {
		if (listPreference.getEntries() == null)
			return "";
		int index = listPreference.findIndexOfValue(value);
		return listPreference.getEntries()[index];
	}

	@Override
	public boolean onPreferenceChange(Preference preference, Object newValue) {
		if (preference == null || preference.getKey() == null)
			return false;

		if (preference.getKey().equals("storageCard")) {
			ListPreference sdcard = (ListPreference) preference;

			moveFilesToNewStorage(newValue.toString());

			String title = getString(R.string.pref_sdcard_title) + ": " + getEntryText(sdcard, newValue.toString());
			sdcard.setTitle(title);
			return true;
		}

		return false;
	}

	private boolean moveFilesToNewStorage(String newStorage) {
// Path: src/main/java/com/axelby/podax/Storage.java
// public class Storage {
// 	public static File getExternalStorageDirectory(Context context) {
// 		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
// 		String storageCard = prefs.getString("storageCard", "/storage/sdcard0");
// 		if (new File(storageCard).exists())
// 			return new File(storageCard);
// 		return Environment.getExternalStorageDirectory();
// 	}
// }


// Path: src/main/java/com/axelby/podax/ui/PodaxPreferenceFragment.java
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import com.axelby.podax.R;
import com.axelby.podax.Storage;
import java.io.File;
import java.util.ArrayList;


		setPreferenceScreen(screen);
	}

	private CharSequence getEntryText(ListPreference listPreference, String value) {
		if (listPreference.getEntries() == null)
			return "";
		int index = listPreference.findIndexOfValue(value);
		return listPreference.getEntries()[index];
	}

	@Override
	public boolean onPreferenceChange(Preference preference, Object newValue) {
		if (preference == null || preference.getKey() == null)
			return false;

		if (preference.getKey().equals("storageCard")) {
			ListPreference sdcard = (ListPreference) preference;

			moveFilesToNewStorage(newValue.toString());

			String title = getString(R.string.pref_sdcard_title) + ": " + getEntryText(sdcard, newValue.toString());
			sdcard.setTitle(title);
			return true;
		}

		return false;
	}

	private boolean moveFilesToNewStorage(String newStorage) {
		File oldStorage = Storage.getExternalStorageDirectory(getActivity());