protected Bitmap doInBackground(Void... args) { try { bitmap = BitmapFactory.decodeStream((InputStream) new URL(subject.getPicture()).getContent()); } catch (Exception e) { e.printStackTrace(); bitmap = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_geometry); } return bitmap; }
protected void onPostExecute(Bitmap image) { customViewHolder.imageView.setImageBitmap(image); customViewHolder.subjectName.setText(subject.getName()); customViewHolder.subjectFollowers.setText("10"); customViewHolder.itemView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent it = new Intent(ctx, SubjectFeedActivity.class); SubjectFeedActivity.subject = subject; ctx.startActivity(it); } }); pDialog.dismiss(); }