// Path: src/main/java/com/axelby/podax/Constants.java
// public class Constants {
// 	public static final int NOTIFICATION_UPDATE = 1;
// 	public static final int SUBSCRIPTION_UPDATE_ERROR = 2;
// 	public static final int NOTIFICATION_PLAYING = 3;
// 	public static final int NOTIFICATION_GPODDER_ERROR = 4;
// 	public static final int NOTIFICATION_DOWNLOAD_ERROR = 5;
// 
// 	// active podcast related
// 	public static final Uri ACTIVE_PODCAST_DATA_RESTART = Uri.parse("podax://activepodcast/restart");
// 	public static final Uri ACTIVE_PODCAST_DATA_BACK = Uri.parse("podax://activepodcast/back");
// 	public static final Uri ACTIVE_PODCAST_DATA_FORWARD = Uri.parse("podax://activepodcast/forward");
// 	public static final Uri ACTIVE_PODCAST_DATA_END = Uri.parse("podax://activepodcast/end");
// 
// 	public static final String ACTION_REFRESH_ALL_SUBSCRIPTIONS = "com.axelby.podax.REFRESH_ALL_SUBSCRIPTIONS";
// 	public static final String ACTION_REFRESH_SUBSCRIPTION = "com.axelby.podax.REFRESH_SUBSCRIPTION";
// 	public static final String ACTION_DOWNLOAD_PODCAST = "com.axelby.podax.DOWNLOAD_PODCAST";
// 	public static final String ACTION_DOWNLOAD_PODCASTS = "com.axelby.podax.DOWNLOAD_PODCASTS";
// 
// 	public static final String EXTRA_PODCAST_ID = "com.axelby.podax.podcastId";
// 	public static final String EXTRA_SUBSCRIPTION_ID = "com.axelby.podax.subscriptionId";
// 	public static final String EXTRA_TITLE = "com.axelby.podax.title";
// 	public static final String EXTRA_URL = "com.axelby.podax.url";
// 	public static final String EXTRA_MANUAL_REFRESH = "com.axelby.podax.manual_refresh";
// 	public static final String EXTRA_FRAGMENT = "com.axelby.podax.fragmentId";
// 
// 	public static final String EXTRA_PLAYER_COMMAND = "com.axelby.podax.player_command";
// 	public static final String EXTRA_PLAYER_COMMAND_ARG = "com.axelby.podax.player_command_arg";
// 	public static final int PLAYER_COMMAND_PLAYPAUSE = 0;
// 	public static final int PLAYER_COMMAND_PLAY = 1;
// 	public static final int PLAYER_COMMAND_PAUSE = 2;
// 	public static final int PLAYER_COMMAND_STOP = 3;
// 	public static final int PLAYER_COMMAND_PLAYSTOP = 4;
// 	public static final int PLAYER_COMMAND_RESUME = 5;
// 	public static final int PLAYER_COMMAND_REFRESHPODCAST = 6;
// 
// 	// reasons for pausing
// 	public static final int PAUSE_AUDIOFOCUS = 0;
// 	public static final int PAUSE_MEDIABUTTON = 1;
// 	public static final int PAUSE_COUNT = 2;
// 
// 	// gpodder constants
// 	public static final String GPODDER_ACCOUNT_TYPE = "com.axelby.gpodder";
// 	public static final int GPODDER_UPDATE_NONE = 0;
// 	public static final int GPODDER_UPDATE_POSITION = 1;
// 	// podax automatically downloads and deletes
// 	// so it doesn't make sense to send these events to gpodder
// 	public static final int GPODDER_UPDATE_DOWNLOAD = 2;
// 	public static final int GPODDER_UPDATE_DELETE = 4;
// 	public static final int GPODDER_UPDATE_NEW = 8;
// }


import android.os.AsyncTask;
import android.os.Bundle;
import android.sax.RootElement;
import android.sax.StartElementListener;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.ListFragment;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.axelby.podax.Constants;
import com.axelby.podax.R;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.util.ArrayList;
				} catch (IllegalStateException e) {
					e.printStackTrace();
				} catch (SAXException e) {
					e.printStackTrace();
				}
				return feeds;
			}

			@Override
			protected void onPostExecute(ArrayList<PodaxFeed> result) {
				// make sure the activity still exists
				if (getActivity() != null) {
					setListAdapter(new ArrayAdapter<PodaxFeed>(getActivity(), android.R.layout.simple_list_item_1, result));
					_loaded = true;
				}
				super.onPostExecute(result);
			}
		}.execute((Void) null);
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		if (!_loaded)
			return;

		PodaxFeed feed = (PodaxFeed) l.getItemAtPosition(position);
		if (feed == null)
			return;

		Bundle args = new Bundle();
// Path: src/main/java/com/axelby/podax/Constants.java
// public class Constants {
// 	public static final int NOTIFICATION_UPDATE = 1;
// 	public static final int SUBSCRIPTION_UPDATE_ERROR = 2;
// 	public static final int NOTIFICATION_PLAYING = 3;
// 	public static final int NOTIFICATION_GPODDER_ERROR = 4;
// 	public static final int NOTIFICATION_DOWNLOAD_ERROR = 5;
// 
// 	// active podcast related
// 	public static final Uri ACTIVE_PODCAST_DATA_RESTART = Uri.parse("podax://activepodcast/restart");
// 	public static final Uri ACTIVE_PODCAST_DATA_BACK = Uri.parse("podax://activepodcast/back");
// 	public static final Uri ACTIVE_PODCAST_DATA_FORWARD = Uri.parse("podax://activepodcast/forward");
// 	public static final Uri ACTIVE_PODCAST_DATA_END = Uri.parse("podax://activepodcast/end");
// 
// 	public static final String ACTION_REFRESH_ALL_SUBSCRIPTIONS = "com.axelby.podax.REFRESH_ALL_SUBSCRIPTIONS";
// 	public static final String ACTION_REFRESH_SUBSCRIPTION = "com.axelby.podax.REFRESH_SUBSCRIPTION";
// 	public static final String ACTION_DOWNLOAD_PODCAST = "com.axelby.podax.DOWNLOAD_PODCAST";
// 	public static final String ACTION_DOWNLOAD_PODCASTS = "com.axelby.podax.DOWNLOAD_PODCASTS";
// 
// 	public static final String EXTRA_PODCAST_ID = "com.axelby.podax.podcastId";
// 	public static final String EXTRA_SUBSCRIPTION_ID = "com.axelby.podax.subscriptionId";
// 	public static final String EXTRA_TITLE = "com.axelby.podax.title";
// 	public static final String EXTRA_URL = "com.axelby.podax.url";
// 	public static final String EXTRA_MANUAL_REFRESH = "com.axelby.podax.manual_refresh";
// 	public static final String EXTRA_FRAGMENT = "com.axelby.podax.fragmentId";
// 
// 	public static final String EXTRA_PLAYER_COMMAND = "com.axelby.podax.player_command";
// 	public static final String EXTRA_PLAYER_COMMAND_ARG = "com.axelby.podax.player_command_arg";
// 	public static final int PLAYER_COMMAND_PLAYPAUSE = 0;
// 	public static final int PLAYER_COMMAND_PLAY = 1;
// 	public static final int PLAYER_COMMAND_PAUSE = 2;
// 	public static final int PLAYER_COMMAND_STOP = 3;
// 	public static final int PLAYER_COMMAND_PLAYSTOP = 4;
// 	public static final int PLAYER_COMMAND_RESUME = 5;
// 	public static final int PLAYER_COMMAND_REFRESHPODCAST = 6;
// 
// 	// reasons for pausing
// 	public static final int PAUSE_AUDIOFOCUS = 0;
// 	public static final int PAUSE_MEDIABUTTON = 1;
// 	public static final int PAUSE_COUNT = 2;
// 
// 	// gpodder constants
// 	public static final String GPODDER_ACCOUNT_TYPE = "com.axelby.gpodder";
// 	public static final int GPODDER_UPDATE_NONE = 0;
// 	public static final int GPODDER_UPDATE_POSITION = 1;
// 	// podax automatically downloads and deletes
// 	// so it doesn't make sense to send these events to gpodder
// 	public static final int GPODDER_UPDATE_DOWNLOAD = 2;
// 	public static final int GPODDER_UPDATE_DELETE = 4;
// 	public static final int GPODDER_UPDATE_NEW = 8;
// }


// Path: src/main/java/com/axelby/podax/ui/ITunesPopularListFragment.java
import android.os.AsyncTask;
import android.os.Bundle;
import android.sax.RootElement;
import android.sax.StartElementListener;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.ListFragment;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.axelby.podax.Constants;
import com.axelby.podax.R;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.util.ArrayList;

				} catch (IllegalStateException e) {
					e.printStackTrace();
				} catch (SAXException e) {
					e.printStackTrace();
				}
				return feeds;
			}

			@Override
			protected void onPostExecute(ArrayList<PodaxFeed> result) {
				// make sure the activity still exists
				if (getActivity() != null) {
					setListAdapter(new ArrayAdapter<PodaxFeed>(getActivity(), android.R.layout.simple_list_item_1, result));
					_loaded = true;
				}
				super.onPostExecute(result);
			}
		}.execute((Void) null);
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		if (!_loaded)
			return;

		PodaxFeed feed = (PodaxFeed) l.getItemAtPosition(position);
		if (feed == null)
			return;

		Bundle args = new Bundle();
		args.putString(Constants.EXTRA_TITLE, feed.title);