How to create a voice button within edittext like google search with voice button. see below image url like that i want. any one suggest me.
Asked
Active
Viewed 2,794 times
2
-
You can create customView that vill extend View class and inside that view add EditText and Button. Then in XML use Tag View to reserve space for your controll and you can add it programatically in code behind. It would be nested like
– user3455363 Sep 10 '14 at 10:01
2 Answers
3
<LinearLayout
android:id="@+id/ll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_weight="0.8"
android:background="@drawable/dialog_edt"
android:orientation="horizontal"
android:weightSum="1" >
<EditText
android:id="@+id/edt_Contact"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.8"
android:background="@android:color/transparent"
android:imeOptions="actionDone"
android:inputType="number|text|numberDecimal"
android:paddingLeft="2dp"
android:singleLine="true" />
<ImageView
android:id="@+id/iv_Mic"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="0.2"
android:src="@drawable/mic" />
</LinearLayout>
This way you can make a clickListener
of Mic to do some stuff.

Nadeem Iqbal
- 2,357
- 1
- 28
- 43
1
You can create an edittext in xml and apply the right drwable for the edittext. This will look like the same. hope this piece of code will help you...
<EditText
android:id="@+id/et_diesel_filtername"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawableRight="your mic icon" />

Sreedev
- 6,563
- 5
- 43
- 66
-
http://stackoverflow.com/questions/3554377/handling-click-events-on-a-drawable-within-an-edittext hope this link will guide you more... – Sreedev Sep 10 '14 at 09:55
-