How can I display 5 different signatures with 5 imageviews that have previously been saved to the gallery with the view button?

103 views Asked by At

enter image description hereI'm building a signature application that can be saved to the gallery. I want to display the signatures in order. after the signature is saved to the gallery then immediately displayed on the available imageview. I have 5 imageviews below

here is my code Signature.java

public void OnViewSignatureClick(View view) {
                ImageView tampilin = (ImageView) findViewById(R.id.imgvwSignature);
                Uri filePath = Uri.parse(path_image);

                try {
                    //Getting the Bitmap from Gallery
                    bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                tampilin.setImageBitmap(bitmap);
            }

XML

<LinearLayout
        android:id="@+id/LinLay01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center|top">

    <ImageView
        android:id="@+id/imgvwSignature"
        android:layout_width="65dp"
        android:layout_height="65dp"
        android:background="#ccc"
        android:layout_margin="5dp"
        android:layout_weight="1"/>

        <ImageView
        android:id="@+id/imgvwSignature0"
        android:layout_width="65dp"
        android:layout_height="65dp"
        android:background="#ccc"
        android:layout_margin="5dp"
        android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature1"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature2"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature3"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>

    </LinearLayout>
0

There are 0 answers