Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public void display(Etablissements Etab) {
  2. currentEtab = Etab;
  3. this.name.setText(Etab.getName());
  4. this.label.setText(Etab.getLabel());
  5.  
  6. String ImagePath = Environment.getExternalStorageDirectory().toString()+"/saved_images/";
  7. File imgFile = new File(ImagePath+Etab.getImg());
  8. if(imgFile.exists()){
  9. Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
  10. if(myBitmap==null){
  11. this.img.setImageResource(R.drawable.ens);
  12. }else{
  13. this.img.setImageBitmap(myBitmap);
  14. }
  15.  
  16. }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement