Can you post the code you used to programmatically create an
EditText ?

The following code snippet in an activity does what you want it to do.

EditText e = new EditText(this);
ViewGroup.LayoutParams vw = new ViewGroup.LayoutParams
(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
addContentView(e, vw);

Hope this helps,
Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.


On Sep 23, 3:58 am, "Sven Mutscher" <sven.mutsc...@gmx.de> wrote:
> Hello,
>
> I have a problem using EditText. What I do is creating an instance using 
> "new" (no xml configuration) and then draw it to my Canvas.
>
> What I do not understand is that nothing happens when clicking into the
> text box. Normally the focus is on the text box, I get a cursor and the 
> virtual keyboard appears, I can make text input etc... !
>
> Creating the EditText element in a layout xml everything works fine. But this 
> is not what I want in that case.
>
> Any ideas ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to