im not sure my codes show exactly what u looking for
but i hope it helpful

(i think the button... it,s not inside the edit text. it's located
next to the edit text)

"main.xml"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/text"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:background="#ffff00"
android:singleLine="true"
/>
<Button
android:id="@+id/button"
android:layout_width="20dip"
android:layout_height="fill_parent"
android:text="x"
android:background="#ffff00"
/>
</LinearLayout>




"test.java"

public class test extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final EditText text = (EditText) findViewById(R.id.text);

        Button btn = (Button) findViewById(R.id.button);
        btn.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View v) {
                                text.setText("");
                        }
                });
    }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to