I have an EditText in my layout file. Once user clicks on this field, I want it to get replaced with the below element tag. How do I do it ?

From:

```
<EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="textPersonName"
            android:text="Name"
            android:ems="10"
            android:layout_alignParentTop="true"
            android:layout_marginTop="26dp" />

```

To:

```
<android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <fragment
                android:id="@+id/autocomplete_fragment"
                android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
    </android.support.v7.widget.CardView>

```