@@ -0,0 +1,1246 @@
+package com.mamewo.malarm24;%0A%0Aimport java.io.IOException;%0A%0Aimport android.content.Context;%0Aimport android.media.MediaPlayer;%0Aimport android.util.Log;%0A%0Aimport com.mamewo.lib.podcast_parser.BaseGetPodcastTask;%0Aimport com.mamewo.lib.podcast_parser.EpisodeInfo;%0A%0Apublic class PlayFirstEpisodeTask%0A%09extends BaseGetPodcastTask%0A%7B%0A%09static final%0A%09private int TIMEOUT_SEC = 30;%0A%09EpisodeInfo info_;%0A%09MediaPlayer player_;%0A%09static final%0A%09private String TAG = %22malarm%22;%0A%09%0A%09public PlayFirstEpisodeTask(Context context, MediaPlayer player) %7B%0A%09%09super(context, 1, TIMEOUT_SEC, false);%0A%09%09player_ = player;%0A%09%09info_ = null;%0A%09%7D%0A%09%0A%09@Override%0A%09protected void onProgressUpdate(EpisodeInfo... values)%7B%0A%09%09if(null != values) %7B%0A%09%09%09info_ = values%5B0%5D;%0A%09%09%09Log.d(TAG, %22onProgress: url %22 + info_.url_);%0A%09%09%7D%0A%09%7D%0A%09%0A%09@Override%0A%09protected void onPostExecute(Void result) %7B%0A%09%09if(null == info_)%7B%0A%09%09%09Log.d(TAG, %22no episode found...%22);%0A%09%09%09return;%0A%09%09%7D%0A%09%09try %7B%0A%09%09%09Log.d(TAG, %22Start playing podcast:%22 + info_.url_);%0A%09%09%09player_.reset();%0A%09%09%09player_.setDataSource(info_.url_);%0A%09%09%09Log.d(TAG, %22prepareAsync%22);%0A%09%09%09player_.prepareAsync();%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09//%0A%09%09%09Log.d(TAG, %22error set data source: %22, e);%0A%09%09%7D%0A%09%7D%0A%09%0A//%09@Override%0A//%09protected void onCancelled() %7B%0A//%09%09onFinished();%0A//%09%7D%0A%7D%0A

add file