Guest User

Untitled

a guest
Dec 14th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. holder.viewThumbnail.setOnClickListener(v ->
  2. {
  3. FetchImage fetchImage = new FetchImage(MainActivity.mainActivity, rootView, position);
  4. fetchImage.execute();
  5. });
  6.  
  7. protected final Void doInBackground(WeakReference<Activity>... params)
  8. {
  9. if(MainActivity.animalList.get(position).getImage() == null)
  10. {
  11. MainActivity mainActivity = weakReferenceActivity.get();
  12. if(mainActivity != null)
  13. {
  14. new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(mainActivity, mainActivity.getString(R.string.fetching_image), Toast.LENGTH_SHORT).show());
  15. }
  16. }
  17. return null;
  18. }
  19.  
  20. protected void onPostExecute(Void result)
  21. {
  22.  
  23.  
  24. super.onPostExecute(result);
  25. MainActivity mainActivity = weakReferenceActivity.get();
  26. if(mainActivity != null)
  27. {
  28. mainActivity.dialogShow(view, C.NO, C.DIALOG_IMAGE, "", "", position);
  29. }
  30. }
Add Comment
Please, Sign In to add comment