Created
April 28, 2016 23:51
-
-
Save FlaviusPopescu/381766d26c5002b2d0e94b167e166e11 to your computer and use it in GitHub Desktop.
Internet and Background Tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
final String IMAGE_URL = "https://pixabay.com/static/uploads/photo/2014/12/22/00/05/spindle-576757_960_720.png"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
final ImageView imageView = (ImageView) findViewById(R.id.headerimage); | |
new ImageDownloaderTask(new ImageDownloaderTask.OnImageDownloadedListener() { | |
@Override | |
public void onImageDownloaded(Bitmap bitmap) { | |
imageView.setImageBitmap(bitmap); | |
} | |
}).execute(IMAGE_URL); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment