	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent intent = this.getIntent();
		if (intent.hasExtra(Constants.EXTRA_PODCAST_ID)) {
			int podcastId = intent.getIntExtra(Constants.EXTRA_PODCAST_ID, -1);
			if (podcastId == -1) {
				finish();
				return;
			}
			Uri uri = ContentUris.withAppendedId(PodcastProvider.URI, podcastId);
			_cursor = getContentResolver().query(uri, _projection, null, null, null);
		} else {
			Uri uri = Uri.withAppendedPath(PodcastProvider.URI, "active");
			_cursor = managedQuery(uri, _projection, null, null, null);
			if (_cursor.isAfterLast()) {
				finish();
				startActivity(new Intent(this, QueueActivity.class));
				return;
			}
		}
		_podcast = new PodcastCursor(this, _cursor);
		_podcastId = _podcast.getId();
		_observer = new PodcastObserver(_handler);
		_podcast.registerContentObserver(_observer);
        setTitle(_podcast.getTitle());
        setContentView(R.layout.podcast_detail);
		_subscriptionTitleView = (TextView)findViewById(R.id.subscription_title);
		_subscriptionTitleView.setText(_podcast.getSubscriptionTitle());
		_descriptionView = (WebView)findViewById(R.id.description);
		String html = "<html><head><style type=\"text/css\">" +
				"a { color: #E59F39 }" +
				"</style></head>" +
				"<body style=\"background:black;color:white\">" + _podcast.getDescription() + "</body></html>"; 
		_descriptionView.loadData(html, "text/html", "utf-8");
		_descriptionView.setBackgroundColor(Color.BLACK);
		_queuePosition = (TextView)findViewById(R.id.queue_position);
		_queueButton = (Button)findViewById(R.id.queue_btn);
		updateQueueViews();
		_queueButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				if (_podcast.getQueuePosition() == null)
					_podcast.addToQueue();
				else
					_podcast.removeFromQueue();
			}
		});
		_restartButton = (ImageButton)findViewById(R.id.restart_btn);
		_restartButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.restart(PodcastDetailActivity.this);
			}
		});
		_rewindButton = (ImageButton)findViewById(R.id.rewind_btn);
		_rewindButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipBack(PodcastDetailActivity.this);
			}
		});
		_playButton = (ImageButton)findViewById(R.id.play_btn);
		_playButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Long activeId = null;
				String[] projection = new String[] { PodcastProvider.COLUMN_ID };
				Cursor c = getContentResolver().query(PodcastProvider.ACTIVE_PODCAST_URI, projection, null, null, null);
				try {
					if (c.moveToNext())
						activeId = c.getLong(0);
					if (Helper.isPlaying(PodcastDetailActivity.this) && 
							activeId != null && activeId.equals(_podcast.getId()))
						PlayerService.pause(PodcastDetailActivity.this);
					else
						PlayerService.play(PodcastDetailActivity.this, _podcast);
				} finally {
					c.close();
				}
			}
		});
		_forwardButton = (ImageButton)findViewById(R.id.forward_btn);
		_forwardButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipForward(PodcastDetailActivity.this);
			}
		});
		_skipToEndButton = (ImageButton)findViewById(R.id.skiptoend_btn);
		_skipToEndButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipToEnd(PodcastDetailActivity.this);
			}
		});
		_seekbar = (SeekBar)findViewById(R.id.seekbar);
		_seekbar.setMax(_podcast.getDuration());
		_seekbar.setProgress(_podcast.getLastPosition());
		_seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				_position.setText(Helper.getTimeString(progress));
			}
			public void onStartTrackingTouch(SeekBar seekBar) {
				_seekbar_dragging = true;
			}
			public void onStopTrackingTouch(SeekBar seekBar) {
				_seekbar_dragging = false;
				PlayerService.skipTo(PodcastDetailActivity.this, seekBar.getProgress() / 1000);
			}
		});
		_seekbar_dragging = false;
		_position = (TextView)findViewById(R.id.position);
		_position.setText(Helper.getTimeString(_podcast.getLastPosition()));
		_duration = (TextView)findViewById(R.id.duration);
		_duration.setText("-" + Helper.getTimeString(_podcast.getDuration() - _podcast.getLastPosition()));
		updatePlayerControls(true);
	}

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent intent = this.getIntent();
		if (intent.hasExtra(Constants.EXTRA_PODCAST_ID)) {
			int podcastId = intent.getIntExtra(Constants.EXTRA_PODCAST_ID, -1);
			if (podcastId == -1) {
				finish();
				return;
			}
			Uri uri = ContentUris.withAppendedId(PodcastProvider.URI, podcastId);
			_cursor = getContentResolver().query(uri, _projection, null, null, null);
		} else {
			Uri uri = Uri.withAppendedPath(PodcastProvider.URI, "active");
			_cursor = managedQuery(uri, _projection, null, null, null);
			if (_cursor.isAfterLast()) {
				finish();
				startActivity(new Intent(this, QueueActivity.class));
				return;
			}
		}
		_podcast = new PodcastCursor(this, _cursor);
		_podcastId = _podcast.getId();
		_observer = new PodcastObserver(_handler);
		_podcast.registerContentObserver(_observer);
        setTitle(_podcast.getTitle());
        setContentView(R.layout.podcast_detail);
		_subscriptionTitleView = (TextView)findViewById(R.id.subscription_title);
		_subscriptionTitleView.setText(_podcast.getSubscriptionTitle());
		_descriptionView = (WebView)findViewById(R.id.description);
		String html = "<html><head><style type=\"text/css\">" +
				"a { color: #E59F39 }" +
				"</style></head>" +
				"<body style=\"background:black;color:white\">" + _podcast.getDescription() + "</body></html>"; 
		_descriptionView.loadData(html, "text/html", "utf-8");
		_descriptionView.setBackgroundColor(Color.BLACK);
		_queuePosition = (TextView)findViewById(R.id.queue_position);
		_queueButton = (Button)findViewById(R.id.queue_btn);
		updateQueueViews();
		_queueButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				if (_podcast.getQueuePosition() == null)
					_podcast.addToQueue();
				else
					_podcast.removeFromQueue();
			}
		});
		_restartButton = (ImageButton)findViewById(R.id.restart_btn);
		_restartButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.restart(PodcastDetailActivity.this);
			}
		});
		_rewindButton = (ImageButton)findViewById(R.id.rewind_btn);
		_rewindButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipBack(PodcastDetailActivity.this);
			}
		});
		_playButton = (ImageButton)findViewById(R.id.play_btn);
		_playButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Long activeId = null;
				String[] projection = new String[] { PodcastProvider.COLUMN_ID };
				Cursor c = getContentResolver().query(PodcastProvider.ACTIVE_PODCAST_URI, projection, null, null, null);
				try {
					if (c.moveToNext())
						activeId = c.getLong(0);
					if (Helper.isPlaying(PodcastDetailActivity.this) && 
							activeId != null && activeId.equals(_podcast.getId()))
						PlayerService.pause(PodcastDetailActivity.this);
					else
						PlayerService.play(PodcastDetailActivity.this, _podcast);
				} finally {
					c.close();
				}
			}
		});
		_forwardButton = (ImageButton)findViewById(R.id.forward_btn);
		_forwardButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipForward(PodcastDetailActivity.this);
			}
		});
		_skipToEndButton = (ImageButton)findViewById(R.id.skiptoend_btn);
		_skipToEndButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				PlayerService.skipToEnd(PodcastDetailActivity.this);
				finish();
				startActivity(new Intent(PodcastDetailActivity.this, PodcastDetailActivity.class));
			}
		});
		_seekbar = (SeekBar)findViewById(R.id.seekbar);
		_seekbar.setMax(_podcast.getDuration());
		_seekbar.setProgress(_podcast.getLastPosition());
		_seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				_position.setText(Helper.getTimeString(progress));
			}
			public void onStartTrackingTouch(SeekBar seekBar) {
				_seekbar_dragging = true;
			}
			public void onStopTrackingTouch(SeekBar seekBar) {
				_seekbar_dragging = false;
				PlayerService.skipTo(PodcastDetailActivity.this, seekBar.getProgress() / 1000);
			}
		});
		_seekbar_dragging = false;
		_position = (TextView)findViewById(R.id.position);
		_position.setText(Helper.getTimeString(_podcast.getLastPosition()));
		_duration = (TextView)findViewById(R.id.duration);
		_duration.setText("-" + Helper.getTimeString(_podcast.getDuration() - _podcast.getLastPosition()));
		updatePlayerControls(true);
	}
