Yep, you can do this. You can do this in the code

Somewhere in your code:


 protected EditText editInput;

 ....

 editInput = (EditText)findViewById(R.id.Port);
 ....

 editPort.setText("your String");





or in your layout xml file:

For example you would add to the section

<EditText

a text attribute

   <EditText
        android:id="@+id/username_edit"
        android:text="NAME"
<======================================== /// Add this
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:scrollHorizontally="true"
        android:autoText="false"
        android:capitalize="none"
        android:gravity="fill_horizontal"
        android:textAppearance="?android:attr/textAppearanceMedium" />


With doing this you should see the default text.


--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·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 Jul 24, 4:58 pm, "daum3...@yahoo.com" <daum3...@yahoo.com> wrote:
> Hello all,
>
> I'm trying to set a text edit dialog box with a default text by
> program.
> (I'm using the text edit dialog box  from the AlertDialogSamples
> prorgam)
>
> Can a text edit dialog box be set with a default text before a user
> input his/her own text into the text edit dialog box?
>
> If I can, how should I do?
>
> Thank you.
--~--~---------~--~----~------------~-------~--~----~
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