FileDocCategorySizeDatePackage
MusicProviderTask.javaAPI DocAndroid 5.1 API2062Thu Mar 12 22:22:44 GMT 2015com.example.android.musicservicedemo.browser

MusicProviderTask

public class MusicProviderTask extends android.os.AsyncTask
Asynchronous task to retrieve the music data using MusicProvider.

Fields Summary
private static final String
TAG
MusicProvider
mMusicProvider
MusicProviderTaskListener
mMusicProviderTaskListener
Constructors Summary
public MusicProviderTask(MusicProvider musicProvider, MusicProviderTaskListener listener)
Initialize the task with the provider to download the music data and the listener to be informed when the task is done.

param
musicProvider
param
listener


                                   
      
              
        mMusicProvider = musicProvider;
        mMusicProviderTaskListener = listener;
    
Methods Summary
protected java.lang.VoiddoInBackground(java.lang.Void arg0)

        try {
            mMusicProvider.retreiveMedia();
        } catch (JSONException e) {
            Log.e(TAG, "::doInBackground:", e);
        }
        return null;
    
protected voidonPostExecute(java.lang.Void result)

        mMusicProviderTaskListener.onMusicProviderTaskCompleted();