[android-beginners] Re: EditText
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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText
http://developer.android.com/reference/android/view/View.OnLongClickListener.html Implement an View.OnLongClickListener and set it to your EditText via EditText txt = (EditText)findViewById(R.id.your_edittext_id); ... txt.setOnLongClickListener(...) Check out http://tseng-blog.nge-web.net/blog/2009/02/14/implementing-listeners-in-your-android-java-application/ and http://tseng-blog.nge-web.net/blog/2009/02/17/how-implement-your-own-listener-android-java/ If you want to know more about listeners and how to implement them. On Jun 14, 6:36 pm, Synapse franzi...@gmail.com wrote: How can I change choise from contextual menu of EditText ( Menu that includes copy/paste funcionality ) ? Anyone has some piece of code? Synapse --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText not honoring width attribute
Unfortunately The layout is honored such that all of the EditText fields expand so that all of them are as big as the largest 1. That is exactly the purpose of TableLayout. If you do not want this behavior, do not use TableLayout. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText appearance
Can i assigne a colorstate list to the background? And how do i change the bordercolor when the edittext gains the focus, without placing a backgroundimage? Tseng schrieb: You could create a colorstate list (xml file in res/drawable), for example http://developer.android.com/reference/android/content/res/ColorStateList.html Here is an example i used for textcolors. Should work for HintColors too! res/drawabale/myedittextcolors.xml: ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:state_pressed=false android:color=@android:color/secondary_text_dark / item android:state_focused=true android:state_pressed=true android:color=@android:color/secondary_text_dark / item android:state_focused=false android:state_pressed=true android:color=@android:color/secondary_text_dark / item android:color=@android:color/secondary_text_dark / /selector Now you only have to assign it to your EditText widget. Edit the XML and change android:textColorHint=#FF to android:textColorHint=@drawable/myedittextcolors and it should work. This is usefull if you want to have different colors depending on the state of the edittext (i.e. if its focused, clicked, etc). For one color, use android:textColorHint=#FF or android:textColorHint=@color/ mycustomcolor if you have defined your color in /res/values/ colors.xml On Mar 10, 11:30 am, Mr.No f.hi...@arcor.de wrote: Hello, how do i change the size, style, typeface of a hint? If the EditText gains the focus the border-color changes to orange, how do i set a other color? rgds Mr.No --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText appearance
thx a lot :) On 10 Mrz., 11:30, Mr.No f.hi...@arcor.de wrote: Hello, how do i change the size, style, typeface of a hint? If the EditText gains the focus the border-color changes to orange, how do i set a other color? rgds Mr.No --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText appearance
You could create a colorstate list (xml file in res/drawable), for example http://developer.android.com/reference/android/content/res/ColorStateList.html Here is an example i used for textcolors. Should work for HintColors too! res/drawabale/myedittextcolors.xml: ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:state_pressed=false android:color=@android:color/secondary_text_dark / item android:state_focused=true android:state_pressed=true android:color=@android:color/secondary_text_dark / item android:state_focused=false android:state_pressed=true android:color=@android:color/secondary_text_dark / item android:color=@android:color/secondary_text_dark / /selector Now you only have to assign it to your EditText widget. Edit the XML and change android:textColorHint=#FF to android:textColorHint=@drawable/myedittextcolors and it should work. This is usefull if you want to have different colors depending on the state of the edittext (i.e. if its focused, clicked, etc). For one color, use android:textColorHint=#FF or android:textColorHint=@color/ mycustomcolor if you have defined your color in /res/values/ colors.xml On Mar 10, 11:30 am, Mr.No f.hi...@arcor.de wrote: Hello, how do i change the size, style, typeface of a hint? If the EditText gains the focus the border-color changes to orange, how do i set a other color? rgds Mr.No --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-beginners] Re: EditText Right Align
android:gravity=right On Wed, Oct 1, 2008 at 12:03 PM, Zachary Becker [EMAIL PROTECTED] wrote: I couldn't find the xml attribute to align a EditText box to the right side. I am using it for numbers so I would prefer it be aligned right. Is there a way to do this, through xml or a function call? Thanks, Zach -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText multiline
how i can use EditText with multiline??? Put android:singleLine=false in your layout XML, or use the equivalent method on the EditText object. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.2 Published! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText to String to int
Oh my god... You know Dan, you've been a great sport to me, I can't thank you enough, I should really open my eyes a little more, I'm so very sorry for wasting your time, haha, I feel incredibly stupid... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText getText() to string for notification
Because message is whatever text is in the EditText whenever this bit of code runs. I assume this is ran in onCreate? Probably this is blank unless you gave it a default value. What you might try is to remove the message variable and then call text.getText().toString() in the Toast.makeText method. On Apr 22, 2:28 pm, Kyle [EMAIL PROTECTED] wrote: Hi, I have my application set to grab the text from an EditText field, but for some reason even if I convert it toString, the returned string always comes back blank. Here is my code: Button button; EditText text; button = (Button) findViewById(R.id.btnOK); text = (EditText) findViewById(R.id.txtCustomerName); final String message = text.getText().toString(); button.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Toast.makeText(HelloWorld.this, message, Toast.LENGTH_SHORT).show(); } }); Sorry for the bad code organization, but copy and paste didn't really work out the way I imagined, Haha. Any help would be great. Also, I tried searching, but for some reason I just can't find a solution. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText getText() to string for notification
Oh boy, so simple, why didn't I think of it, trying to get something that doesn't exist... Thanks a ton Dan, I'll try to stay within reality next time, haha. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---