Just grab a Relative Layout and on the right side of the EditText set ImageView with an * image source like this,

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/edit_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dip" android:text="Hello World" /> <ImageView android:layout_toRightOf="@id/edit_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@id/edit_text" android:src="@drawable/star"/> </RelativeLayout>
Output:

Lalit poptani
source share