package com.example.patrice.rerservation01;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import java.io.File;

public class load_imageview extends AppCompatActivity
{
    ImageView ImageView;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.load_imageview_layout);

        getSupportActionBar().setTitle("Gestion de la DB");
        getSupportActionBar().setDisplayUseLogoEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);

        ImageView = (ImageView) findViewById(R.id.imageView);

        String filename = "";

        filename = File.separator + "patoche_image_05-03-2018__11:00:55" + ".jpeg";
        String sdPath = Environment.getExternalStorageDirectory() + filename;
        File imgFile = new File(sdPath);

        if(imgFile.exists())
        {
            Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
            ImageView.setImageBitmap(myBitmap);
        }

    }
}