Add custom Popup/view to activity in android
<p>I'm starting in Android development and don't still get how to do this. I have a ListView, when the user taps one of the items I wan´t to display some information about it.
A popup like this:
<a href="https://i.stack.imgur.com/zjByI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zjByI.png" alt="enter image description here" /></a></p>
<p>That's the way it should look, I already have the XML which is this:</p>
<pre><code>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
android:layout_width=&quot;match_parent&quot;
android:layout_height=&quot;match_parent&quot;
android:background=&quot;#b5000000&quot;&gt;

&lt;RelativeLayout
    android:layout_width=&quot;340dp&quot;
    android:layout_height=&quot;400dp&quot;
    android:columnCount=&quot;20&quot;
    android:layout_centerVertical=&quot;true&quot;
    android:layout_centerHorizontal=&quot;true&quot;
    android:padding=&quot;10dp&quot;
    android:background=&quot;@drawable/menubutton&quot;&gt;

    &lt;Button
        android:layout_width=&quot;50dp&quot;
        android:layout_height=&quot;50dp&quot;
        android:text=&quot;X&quot;
        android:id=&quot;@+id/infraccionesPopUpCerrar&quot;
        android:layout_gravity=&quot;right|top&quot;
        android:layout_row=&quot;0&quot;
        android:layout_column=&quot;19&quot;
        android:layout_alignParentTop=&quot;true&quot;
        android:layout_alignParentEnd=&quot;true&quot; /&gt;

    &lt;ImageView
        android:layout_width=&quot;50dp&quot;
        android:layout_height=&quot;50dp&quot;
        android:id=&quot;@+id/imageView8&quot;
        android:layout_row=&quot;2&quot;
        android:layout_column=&quot;10&quot;
        android:layout_below=&quot;@+id/infraccionesPopUpCerrar&quot;
        android:layout_centerHorizontal=&quot;true&quot; /&gt;

    &lt;TextView
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;200dp&quot;
        android:text=&quot;Aqui se detallaran las causas de la infraccion&quot;
        android:id=&quot;@+id/infraccionesPopUpCausa&quot;
        android:layout_column=&quot;0&quot;
        android:layout_row=&quot;3&quot;
        android:layout_columnSpan=&quot;20&quot;
        android:layout_below=&quot;@+id/imageView8&quot;
        android:layout_alignParentStart=&quot;true&quot;
        android:layout_marginTop=&quot;43dp&quot; /&gt;

    &lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textAppearance=&quot;?android:attr/textAppearanceSmall&quot;
        android:text=&quot;Small Text&quot;
        android:id=&quot;@+id/infraccionesPopUpFecha&quot;
        android:layout_alignParentTop=&quot;true&quot;
        android:layout_alignParentStart=&quot;true&quot; /&gt;

    &lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textAppearance=&quot;?android:attr/textAppearanceMedium&quot;
        android:text=&quot;PAGADA&quot;
        android:id=&quot;@+id/infraccionesPopUpSituacion&quot;
        android:layout_below=&quot;@+id/infraccionesPopUpCausa&quot;
        android:layout_alignStart=&quot;@+id/infraccionesPopUpCausa&quot; /&gt;

    &lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textAppearance=&quot;?android:attr/textAppearanceSmall&quot;
        android:text=&quot;Folio: 00000000&quot;
        android:id=&quot;@+id/infraccionesPopUpFolio&quot;
        android:layout_alignParentBottom=&quot;true&quot;
        android:layout_alignStart=&quot;@+id/infraccionesPopUpSituacion&quot; /&gt;

    &lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textAppearance=&quot;?android:attr/textAppearanceLarge&quot;
        android:text=&quot;Estacionamiento prohibido&quot;
        android:id=&quot;@+id/infraccionesPopUpTitulo&quot;
        android:layout_below=&quot;@+id/imageView8&quot;
        android:layout_centerHorizontal=&quot;true&quot;
        android:textColor=&quot;#74cb51&quot; /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>How do I instantiate this Popup so I can change the content of the textviews inside? The information that displays the popup depends on what item he tap</p>