Back to project page RateBeer-Mobile.
The source code is released under:
GNU General Public License
If you think the Android project RateBeer-Mobile listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package dk.moerks.ratebeermobile.task; //from w ww .java 2 s .com import android.content.Context; import android.graphics.drawable.Drawable; import dk.moerks.ratebeermobile.BeerView; import dk.moerks.ratebeermobile.R; import dk.moerks.ratebeermobile.activity.BetterRBActivity; import dk.moerks.ratebeermobile.io.NetBroker; public class RetrieveBeerImageTask extends BetterRBTask<String, Drawable> { public RetrieveBeerImageTask(BetterRBActivity activity) { super(activity, R.string.task_fetchbeerimage); } @Override protected Drawable doCheckedInBackground(Context context, String... params) throws Exception { // Get a specific beer image Drawable responseDrawable = NetBroker.doGetImage(context, null, "http://www.ratebeer.com/beerimages/"+params[0]+".jpg"); return responseDrawable; } @Override protected void afterTask(BetterRBActivity activity, Drawable result) { ((BeerView)activity).onImageRetrieved(result); } }