[android-developers] Re: EditText stops displaying characters as I'm typing?
I am finding the same problem in my Kindle tablet. While typing 1st letter its not showing and after that from 2d to 8th letter its showing and there after it is not showing. This issue happens with the edittext of some activities. Some other Activities are having the edittext with same attribute, but thos are not having this problem. Can you please help, how you solved it? On Saturday, 14 May 2011 01:54:31 UTC+5:30, Ben S wrote: Basically what happens is I will start typing on the keyboard (stock and third party), and all of a sudden it stops showing characters I type in the EditText, (sometimes) resets the caret to the beginning, yet I know I'm still typing because the suggestions box shows the characters as I type. I've experienced the behavior on at least 5 different devices (running 2.2, 2.3) as well as the emulator (running 2.1) but can't seem to nail down a solution. It is seemingly random; I'm not reading any error logs through DDMS from the system, (the only thing I see being written :sometimes: is WARN/IInputConnectionWrapper(991): endBatchEdit on inactive InputConnection) so I'm a little baffled. Here is what it looks like: http://i.stack.imgur.com/gsB49.png Here is the XML layout of the EditText: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=wrap_content android:layout_weight=1 android:transcriptMode=alwaysScroll/ EditText android:id=@+id/etMain android:layout_width=fill_parent android:layout_height=wrap_content android:inputType=text|textAutoCorrect android:imeOptions=actionSend requestFocus / /EditText /LinearLayout And here is my code from the Activity: et = (EditText) findViewById(R.id.etMain); et.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if ((event != null (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || actionId == EditorInfo.IME_ACTION_SEND) { String sendText = v.getText().toString(); if (sendText.length() 0) { v.setText(); } } return true; } return false; } }); Appreciate any insights...let me know if you need anything else... Ben -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Edittext - can't type
My post was used for you? On Friday, February 15, 2013 7:01:40 PM UTC+5:30, Sagar Rout wrote: Yes i that is what i m trying to tell you and help me if you can Thanks On Friday, 15 February 2013 15:45:09 UTC+5:30, Tamilarasi Sivaraj wrote: hi aru you told you only used to emulator keypad for typing not used for your system keyboard right? On Friday, February 15, 2013 10:32:49 AM UTC+5:30, Sagar Rout wrote: I am a newbie in android developement. i am not able to entered or type in edittext using keyboard and whiledouble click , able to entered using Android emulator keyboard. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Edittext - can't type
hi aru you told you only used to emulator keypad for typing not used for your system keyboard right? On Friday, February 15, 2013 10:32:49 AM UTC+5:30, Sagar Rout wrote: I am a newbie in android developement. i am not able to entered or type in edittext using keyboard and whiledouble click , able to entered using Android emulator keyboard. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Edittext - can't type
Yes i that is what i m trying to tell you and help me if you can Thanks On Friday, 15 February 2013 15:45:09 UTC+5:30, Tamilarasi Sivaraj wrote: hi aru you told you only used to emulator keypad for typing not used for your system keyboard right? On Friday, February 15, 2013 10:32:49 AM UTC+5:30, Sagar Rout wrote: I am a newbie in android developement. i am not able to entered or type in edittext using keyboard and whiledouble click , able to entered using Android emulator keyboard. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Edittext - can't type
Hi This is how I fixed it: 1. Eclipse Window menu AVD Manager 2. Select your virtual device and click Edit 3. Under Hardware, Click New 4. Select Keyboard Support then click OK 5. Edit its value to yes 6. Now you have to click off onto another item in the list, like Abtract LCD Density or something. This seems to make the UI keep the yes change. thanks, On Friday, February 15, 2013 10:32:49 AM UTC+5:30, Sagar Rout wrote: I am a newbie in android developement. i am not able to entered or type in edittext using keyboard and whiledouble click , able to entered using Android emulator keyboard. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Edittext - can't type
Tamilarasi Sivaraj wrote: This is how I fixed it: 1. Eclipse Window menu AVD Manager Or use android avd . 1. Select your virtual device and click Edit 2. Under Hardware, Click New 3. Select Keyboard Support then click OK 4. Edit its value to yes 5. Now you have to click off onto another item in the list, like Abtract LCD Density or something. This seems to make the UI keep the yes change. No, you don't have to do that. You just edit the AVD and set the value to yes as a second action. No need for bogus hardware configuration. -- Lew -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: EditText hint shows extra spaces when inputType=textpassword
Check here! it is marked as resolved. http://stackoverflow.com/questions/7245220/edittext-hint-shows-extra-spaces-when-inputtype-textpassword?rq=1 Op dinsdag 5 januari 2010 03:33:31 UTC+1 schreef csyperski het volgende: I am seeing the same behavior, did you find any fix for this? On Dec 23 2009, 7:22 am, GDroid baron...@gmail.com wrote: Hi, Just wondered, am I the only one to encounter this strange behavior. When placing an EditText inside my activity and setting its inputType=textPassword as follow: EditText android:text= android:id=@+id/EditText01 android:hint=This is a hint android:inputType=textPassword android:layout_width=wrap_content android:layout_height=wrap_content/EditText The hint is displayed with bigger/double spaces between the words. If I remove the inputType attribute it all goes back to normal. I couldn't find a known issue regarding this behavior. BTW- If you wonder why this is important (it isn't that much) try putting two EditText widgets one below the other and set the inputType of one of them to textpassword it doesn't look good. Any comments? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText selectAll() does not work in ICS
Hi, this works for me: new Handler().post(new Runnable() { @Override public void run() { paidView.selectAll(); } }); On Thursday, February 2, 2012 5:12:54 AM UTC+1, Michel Stéphane Bruno wrote: Hi, I am trying to programmatically select all the text in an EditText field when a user touches the field so that when the user starts typing it replaces the existing text (I cannot use settings in the XML file because this field is programmatically added to the screen). To do this, I attached an OnFocusChangeListener to the EditText field. The onFocusChange method is below: @Override public void onFocusChange(View v, boolean hasFocus) { EditText editText = (EditText) v; if (hasFocus) editText.selectAll(); } This works fine on Android 2.x, but it does not work in ICS. After touching the EditText field, the cursor just sits in the begin of the field and the text is not selected. Is it a bug? Is there a workaround? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: edittext focus in tablerow
Hi See this http://lmgtfy.com/?q=requestfocus+android Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: edittext focus in tablerow
This is the example: EditText android:id=@+id/editTextCurrentPassword android:layout_width=wrap_content android:layout_height=37dp * requestFocus /* /EditText -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText not Accepting Soft Keyboard Input from Supporting Activity
Does anyone know how to debug the soft keyboard and identify what widget it's targeting? Thanks. Chris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText input into array
On Wed, Feb 29, 2012 at 12:53 AM, minnie me mgm...@gmail.com wrote: This is my new updated code, it prints out blank input in the array...so why is it not storing my user input? Your variable player is never set to the text after clicking your button. I think you need to spend some time learning Java before you jump into Android. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText input into array
got it..i put it after the button click now..and i don't have tiime to learn java first..i need to do both. thanks On Feb 29, 8:27 am, TreKing treking...@gmail.com wrote: On Wed, Feb 29, 2012 at 12:53 AM, minnie me mgm...@gmail.com wrote: This is my new updated code, it prints out blank input in the array...so why is it not storing my user input? Your variable player is never set to the text after clicking your button. I think you need to spend some time learning Java before you jump into Android. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText input into array
It doesn't store array and allow me to display it on click On Feb 28, 8:45 am, TreKing treking...@gmail.com wrote: On Mon, Feb 27, 2012 at 9:45 PM, minnie me mgm...@gmail.com wrote: Add more button and storing to array doesn't quite work Would you explain what doesn't quite work means?http://www.catb.org/~esr/faqs/smart-questions.html - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText input into array
On Tue, Feb 28, 2012 at 11:46 AM, minnie me mgm...@gmail.com wrote: It doesn't store array and allow me to display it on click That's still quite ambiguous. Read the link I gave you, then please try again, with more detail. Explain what you are doing. Pretend we have no knowledge of your problem since, you know, we don't. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText input into array
This is my new updated code, it prints out blank input in the array...so why is it not storing my user input? public class Screen2 extends Activity { EditText txt1; String player; ArrayListString playerList = new ArrayListString(); /** Called when the activity is first created. **/ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.screen2); // edittext1 or textview1 txt1 = (EditText) findViewById(R.id.editText1); player = txt1.getText().toString(); //add more items button Button more = (Button) findViewById(R.id.button1); more.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view){ if (txt1.getText().toString().length() !=0){ playerList.add(player); } System.out.println(playerList.toString()); } }); On Feb 28, 12:54 pm, TreKing treking...@gmail.com wrote: On Tue, Feb 28, 2012 at 11:46 AM, minnie me mgm...@gmail.com wrote: It doesn't store array and allow me to display it on click That's still quite ambiguous. Read the link I gave you, then please try again, with more detail. Explain what you are doing. Pretend we have no knowledge of your problem since, you know, we don't. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with bitmaps
You can create a style.xml and define the customize the propertie parent=@android:style/Widget.EditText there. On 2 Fev, 13:24, Robert Slama robsl...@gmail.com wrote: Hi guys, is any way how make edittext custumized as is on attached image? r^ edittext.png 23KVerTransferir -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Edittext Scrolling
Hmm I'm not 100% clear, but I think that you will get the behavior that you want if you extend the EditText class and override the onTouchEvent() method: public boolean onTouchEvent(MotionEvent ev) { boolean canScroll = !this.isFocusable() || !this.isEnabled() || (this.isFocused() this.isFocusable() this.isEnabled() ); if (ev.getAction() == MotionEvent.ACTION_DOWN canScroll) { this.getParent().requestDisallowInterceptTouchEvent(true); } if (ev.getAction() == MotionEvent.ACTION_UP) { this.getParent().requestDisallowInterceptTouchEvent(false); } return super.onTouchEvent(ev); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText in ListView footer not visible when the soft keyboard is present
The problem is that the list activity is contained in a tab activity that needs to set to adjustPan. When I make the tab activity adjustResize too, everything works as expected. I'm guessing I'll need to work some magic in code. Does anyone have an suggestions on where to start? Thanks. On Jan 30, 9:34 am, ivan istas...@gmail.com wrote: Anyone? On Jan 27, 12:44 pm, ivan istas...@gmail.com wrote: I have a ListView and I'm placing an EditText view in its footer, but the soft keyboard blocks the EditText view when it pops up. My AndroidManifest has: activity android:name=com.myapp.views.activities.StoresSearchActivity android:label=@string/appName android:screenOrientation=portrait android:launchMode=singleInstance android:windowSoftInputMode=adjustResize / My activity layout: ListView android:id=@+id/stores_preferredStores xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:dividerHeight=0dp android:divider=# android:overScrollFooter=@null / My footer is a complex view with a couple different buttons and an edit text view so it doesn't make sense to not have it scroll with the list view, being so tall. My footer layout: RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/footerlayout android:layout_width=fill_parent android:layout_height=wrap_content android:layout_marginBottom=10dp TextView android:layout_height=wrap_content android:id=@+id/store_search_text android:text=@string/store_search_find_header_text android:layout_width=fill_parent android:layout_marginLeft=10dp android:layout_marginRight=10dp android:textColor=@color/white android:layout_alignParentLeft=true /TextView Button android:id=@+id/store_search_use_location_button android:layout_width=fill_parent android:layout_marginTop=10dp android:layout_height=40dp android:layout_below=@id/store_search_text android:text=@string/store_search_location_button_text android:layout_alignLeft=@id/store_search_text android:layout_alignRight=@id/store_search_text style=@style/ActionButton.LtBlue /Button TextView android:layout_height=wrap_content android:id=@+id/store_search_or android:text=Or android:textColor=@color/white android:layout_width=fill_parent android:layout_marginTop=10dp android:layout_below=@id/ store_search_use_location_button android:layout_alignLeft=@+id/ store_search_use_location_button android:layout_alignRight=@+id/ store_search_use_location_button /TextView EditText android:layout_height=wrap_content android:id=@+id/store_search_query android:layout_width=fill_parent android:layout_marginLeft=10dp android:layout_marginRight=10dp android:layout_marginTop=10dp android:paddingLeft=5dp android:layout_below=@id/store_search_or android:hint=@string/search_hint android:inputType=textPostalAddress android:imeOptions=actionDone /EditText Button android:id=@+id/store_search_find_location android:layout_width=fill_parent android:layout_height=40dp android:layout_below=@id/store_search_query android:text=@string/ store_search_find_location_button_text android:layout_alignLeft=@+id/store_search_query android:layout_alignRight=@+id/store_search_query style=@style/ActionButton.LtBlue /Button /RelativeLayout I've set up an OnScrollListener, and it appears the ListView is not getting resized as it should when the soft keyboard pops up. Does anyone have any ideas on how I can get the EditText above the soft keyboard? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText in ListView footer not visible when the soft keyboard is present
Anyone? On Jan 27, 12:44 pm, ivan istas...@gmail.com wrote: I have a ListView and I'm placing an EditText view in its footer, but the soft keyboard blocks the EditText view when it pops up. My AndroidManifest has: activity android:name=com.myapp.views.activities.StoresSearchActivity android:label=@string/appName android:screenOrientation=portrait android:launchMode=singleInstance android:windowSoftInputMode=adjustResize / My activity layout: ListView android:id=@+id/stores_preferredStores xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:dividerHeight=0dp android:divider=# android:overScrollFooter=@null / My footer is a complex view with a couple different buttons and an edit text view so it doesn't make sense to not have it scroll with the list view, being so tall. My footer layout: RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/footerlayout android:layout_width=fill_parent android:layout_height=wrap_content android:layout_marginBottom=10dp TextView android:layout_height=wrap_content android:id=@+id/store_search_text android:text=@string/store_search_find_header_text android:layout_width=fill_parent android:layout_marginLeft=10dp android:layout_marginRight=10dp android:textColor=@color/white android:layout_alignParentLeft=true /TextView Button android:id=@+id/store_search_use_location_button android:layout_width=fill_parent android:layout_marginTop=10dp android:layout_height=40dp android:layout_below=@id/store_search_text android:text=@string/store_search_location_button_text android:layout_alignLeft=@id/store_search_text android:layout_alignRight=@id/store_search_text style=@style/ActionButton.LtBlue /Button TextView android:layout_height=wrap_content android:id=@+id/store_search_or android:text=Or android:textColor=@color/white android:layout_width=fill_parent android:layout_marginTop=10dp android:layout_below=@id/ store_search_use_location_button android:layout_alignLeft=@+id/ store_search_use_location_button android:layout_alignRight=@+id/ store_search_use_location_button /TextView EditText android:layout_height=wrap_content android:id=@+id/store_search_query android:layout_width=fill_parent android:layout_marginLeft=10dp android:layout_marginRight=10dp android:layout_marginTop=10dp android:paddingLeft=5dp android:layout_below=@id/store_search_or android:hint=@string/search_hint android:inputType=textPostalAddress android:imeOptions=actionDone /EditText Button android:id=@+id/store_search_find_location android:layout_width=fill_parent android:layout_height=40dp android:layout_below=@id/store_search_query android:text=@string/ store_search_find_location_button_text android:layout_alignLeft=@+id/store_search_query android:layout_alignRight=@+id/store_search_query style=@style/ActionButton.LtBlue /Button /RelativeLayout I've set up an OnScrollListener, and it appears the ListView is not getting resized as it should when the soft keyboard pops up. Does anyone have any ideas on how I can get the EditText above the soft keyboard? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Edittext in Listview crashes on Android 2.2.3 on back during editing
Thanks a lot poncho. Well that leads to few other questions: Say I have 1000 items and i want to give in-place editing (say not using ListView) so now I have to create 1000 editboxes in a LinearLayout. Can't it make more sense to use ListView so that EditBoxes can be re- cycled? Creating 100 EditBox does not make sense. Also I understand there are focus issues and what not when using EditBox with ListView, but I can't understand why it is crashing with Handle visible in EditBox (in ListView)? Now other option is to give user a way to edit one item in a small dialog. But his solution is not very elegant for End User. On Dec 14, 4:41 am, poncho poncho...@gmail.com wrote: On 12/14/2011 09:13 AM, havexz wrote: thanks for referring. Questions below are still open: OPEN Questions: 1. Is someone else also face this issue? I did, this is how I found the link I sent. 2. Any reason why normal EditText works but EditText in ListView dont? Did you read the thread in the link I sent, the first reply suggest that: ListView isn't really meant to handle that type of UI with editableentries 3. Why IME cursor handle is giving issue in ListView but not elsewhere? Same as 2. Regarding Also is it good to put EditText in ListView or there are better options? I have soln for maintaining the content. I can have text watcher or something. From the same thread: vertical LinearLayout wrapped ina ScrollView, containing horizontal LinearLayours of the EditTexts andButtons Hope this helps /Yaron On Dec 14, 12:45 am, ponchoponcho...@gmail.com wrote: http://groups.google.com/group/android-developers/browse_thread/threa... On 12/14/2011 08:08 AM, havexz wrote: Hi So here is what I did. I have a ListView and each item in it is a EditText. Now, just so you know I am using CursorAdapter with ListView, and I am creating EditText in newView and filling it with some text in bindView. Now how to recreate the issue, I just open the activity, click on any of the EditText and just click enough to see the orange color handle appears with cursor. Now just press back twice. Just press fast enough that orange handle still visible on screen. Now wait a sec and you have: . has leaked window . that was originally added here. I tried the normal EditText without the ListView and that works fine. What I think is that IME cursor handle is retaining the EditText and leading to leak. I also tried EditText with only 'hint' (empty EditText) and got same issue in the ListView. Now my questions: Is someone else also face this issue? Any reason why normal EditText works but EditText in ListView dont? Also is it good to put EditText in ListView or there are better options? Well this might be a common issue and some common soln. but I searched it found no good soln. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Edittext in Listview crashes on Android 2.2.3 on back during editing
On 12/14/2011 09:13 AM, havexz wrote: thanks for referring. Questions below are still open: OPEN Questions: 1. Is someone else also face this issue? I did, this is how I found the link I sent. 2. Any reason why normal EditText works but EditText in ListView dont? Did you read the thread in the link I sent, the first reply suggest that: ListView isn't really meant to handle that type of UI with editableentries 3. Why IME cursor handle is giving issue in ListView but not elsewhere? Same as 2. Regarding Also is it good to put EditText in ListView or there are better options? I have soln for maintaining the content. I can have text watcher or something. From the same thread: vertical LinearLayout wrapped ina ScrollView, containing horizontal LinearLayours of the EditTexts andButtons Hope this helps /Yaron On Dec 14, 12:45 am, ponchoponcho...@gmail.com wrote: http://groups.google.com/group/android-developers/browse_thread/threa... On 12/14/2011 08:08 AM, havexz wrote: Hi So here is what I did. I have a ListView and each item in it is a EditText. Now, just so you know I am using CursorAdapter with ListView, and I am creating EditText in newView and filling it with some text in bindView. Now how to recreate the issue, I just open the activity, click on any of the EditText and just click enough to see the orange color handle appears with cursor. Now just press back twice. Just press fast enough that orange handle still visible on screen. Now wait a sec and you have: . has leaked window . that was originally added here. I tried the normal EditText without the ListView and that works fine. What I think is that IME cursor handle is retaining the EditText and leading to leak. I also tried EditText with only 'hint' (empty EditText) and got same issue in the ListView. Now my questions: Is someone else also face this issue? Any reason why normal EditText works but EditText in ListView dont? Also is it good to put EditText in ListView or there are better options? Well this might be a common issue and some common soln. but I searched it found no good soln. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Edittext in Listview crashes on Android 2.2.3 on back during editing
thanks for referring. Questions below are still open: OPEN Questions: 1. Is someone else also face this issue? 2. Any reason why normal EditText works but EditText in ListView dont? 3. Why IME cursor handle is giving issue in ListView but not elsewhere? Regarding Also is it good to put EditText in ListView or there are better options? I have soln for maintaining the content. I can have text watcher or something. On Dec 14, 12:45 am, poncho poncho...@gmail.com wrote: http://groups.google.com/group/android-developers/browse_thread/threa... On 12/14/2011 08:08 AM, havexz wrote: Hi So here is what I did. I have a ListView and each item in it is a EditText. Now, just so you know I am using CursorAdapter with ListView, and I am creating EditText in newView and filling it with some text in bindView. Now how to recreate the issue, I just open the activity, click on any of the EditText and just click enough to see the orange color handle appears with cursor. Now just press back twice. Just press fast enough that orange handle still visible on screen. Now wait a sec and you have: . has leaked window . that was originally added here. I tried the normal EditText without the ListView and that works fine. What I think is that IME cursor handle is retaining the EditText and leading to leak. I also tried EditText with only 'hint' (empty EditText) and got same issue in the ListView. Now my questions: Is someone else also face this issue? Any reason why normal EditText works but EditText in ListView dont? Also is it good to put EditText in ListView or there are better options? Well this might be a common issue and some common soln. but I searched it found no good soln. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText resize problem
I've noticed that my Nexus S (Android 2.3) does show multiple lines in Landscape mode, while my Samsung Galaxy S (2.2) does not - for the same app. Is this behavior in any way related to the Android version, or how can I influence this? Thx, Mark-Jan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText key press
Apparently the onKeyListener doesn't work for soft keyboards, and I cannot use a TextWatcher as I need the specific KEY_UP and KEY_DOWN events. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
I'll be surprised if this is possible. For starters, it might not be a keyboard and therefore may not have the concept of keys, such as: https://market.android.com/details?id=com.access_company.graffitihl=en On Tue, Nov 1, 2011 at 9:16 AM, Aki arnab...@gmail.com wrote: Apparently the onKeyListener doesn't work for soft keyboards, and I cannot use a TextWatcher as I need the specific KEY_UP and KEY_DOWN events. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
Thats sad. Actually I need to detect Key combos. I figured detecting the key press events was the best way to proceed. Can you suggest an alternative? Some way using which I will be able to detect key combinations? I know key combinations are not an Android convention. Still, I would like to try something out. Any help would be great :) - Aki PS : Big fan of your books. Keep up the good work! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
Surprisingly I am able to detect the key press event of the ENTER key of the soft keyboard, but not of the character keys. That doesn't seem like very consistent behaviour, if they don't work, none of them should work. Whats is special about the ENTER key? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
On Tue, Nov 1, 2011 at 9:33 AM, Aki arnab...@gmail.com wrote: Thats sad. Actually I need to detect Key combos. I figured detecting the key press events was the best way to proceed. Can you suggest an alternative? Some way using which I will be able to detect key combinations? I would not recommend using key combinations. I know key combinations are not an Android convention. Correct. Beyond that, there's no native support for the concept. KeyEvents can have a meta key (e.g., ALT) mixed in with a regular key, but that's it. Still, I would like to try something out. Any help would be great :) You're welcome to subclass EditText, implement onKeyDown() and try stuff out, but I think you're going to have problems. For example, let's say you wanted to do something when the user pressed A and B at the same time. You're going to have two KeyEvents, one for A and one for B. Let's say A arrives first in onKeyDown(). You have no way to know if B will be forthcoming or not. If you chain to the superclass for A, you will wind up with an A in the EditText. If the user then presses B, not only will you need to do whatever key combination logic you want, but you will also have to get rid of the A. Also, bear in mind that device manufacturers tend to tinker with EditText more than other widgets. Context menus, for example, are unreliable, as some device manufacturers appear to have implemented their own long-click handler and are bypassing the context menu system. It's entirely possible device manufacturers are playing games with keypresses as well, in ways that might foul up whatever sort of key combination support you manage to work out. Also also, bear in mind that not all devices are multitouch, and the emulator is not multitouch. PS : Big fan of your books. Keep up the good work! Thanks! -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
On Tue, Nov 1, 2011 at 9:41 AM, Aki arnab...@gmail.com wrote: Surprisingly I am able to detect the key press event of the ENTER key of the soft keyboard, but not of the character keys. That doesn't seem like very consistent behaviour, if they don't work, none of them should work. Whats is special about the ENTER key? Particularly on tablets, it triggers the action, at least on single-line EditTexts. Perhaps that is why they treat it a bit differently. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
Thank you for the elaborate answer Mark. I will try out extending EditText. You see, I came up with the idea of key combinations because I needed something corresponding to a shortcut, without taking up screen space. I am unwilling to use long clicks or gestures as they take too long to execute. If its a shortcut the user should be able to do it quickly. So, how can I implement a shortcut without key combinations? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
On Tue, Nov 1, 2011 at 9:49 AM, Aki arnab...@gmail.com wrote: Thank you for the elaborate answer Mark. I will try out extending EditText. You see, I came up with the idea of key combinations because I needed something corresponding to a shortcut, without taking up screen space. I have no idea what a shortcut is. If you don't put it on the screen, many users won't find it. This is why the options menu is now in the action bar and why context menus are waning in popularity. Even gestures are troublesome if there's no visual cue to suggest that some sort of swipe is possible and will have an effect. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText key press
I wouldn't worry about users finding it, my target users will already know them. Anyway, I'll give the custom EditText a shot, otherwise I'll have to figure something else out. Thanks for the help :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with custom behavior
public class CustomEditText extends EditText { //code here } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with custom behavior
package com.example.custom.edit.text; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.LinearLayout; public class CustomEditTextActivity extends Activity { public static class CustomEditText extends EditText { public CustomEditText(Context context) { super(context); setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // TODO This isn't called till we setFocusableInTouchMode(false) ((CustomEditText) arg0).setText(SELECTED); } }); setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View arg0) { // TODO request focus and show soft keyboard if necessary return false; } }); } // TODO save this so that some listener can // restore it to NORMAL state private static CustomEditText mLastTapped; } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); CustomEditText cet; for (int i = 0; i 5; i++) { cet = new CustomEditText(this); cet.setText(NORMAL STATE); cet.setBackgroundColor(Color.WHITE); cet.setSelectAllOnFocus(true); layout.addView(cet, new LinearLayout.LayoutParams(-1, -1, 1)); } setContentView(layout); } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with custom behavior
Link to pastebin http://pastebin.com/BEp4z2kb I hope someone can help me. It seemed a trivial task when I designed my project, but know I really can't go on. I pasted a self contained Android activity with my custom widget. You only need to create a new Android project with the following settings in Eclipse - CustomEditTextActivity - package com.example.custom.edit.text -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with custom behavior
Here is something I came up. I haven't worked out all the details, but maybe this will get you started. It works by using a RelativeLayout and when you tap on a TextView, it just sets the bounds of an EditText to match the TextView. It then hides the TextView and layers the EditText on the invisible view. I know I didn't handle the click-change-color and long-click-change-view idea, but these should be fairly easy to add. XML Layout: swap_view.xml --- ?xml version=1.0 encoding=utf-8? RelativeLayout android:id=@+id/rlHolder xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent TextView android:id=@+id/tvReplace android:layout_width=match_parent android:layout_height=40dp android:text=Test Text android:textSize=20dp / /RelativeLayout Activity Code public class SwapViewActivity extends Activity implements OnClickListener { private RelativeLayout rlHolder; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView( R.layout.swap_view ); rlHolder = (RelativeLayout)findViewById( R.id.rlHolder ); TextView tvReplace = (TextView)findViewById( R.id.tvReplace ); tvReplace.setOnClickListener( this ); } @Override public void onClick( View v ) { switch( v.getId() ) { case R.id.tvReplace: { RelativeLayout.LayoutParams rlpParams = new RelativeLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); rlpParams.addRule( RelativeLayout.ALIGN_LEFT, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_TOP, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_RIGHT, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_BOTTOM, v.getId() ); v.setVisibility( View.INVISIBLE ); EditText etReplace = new EditText( this ); etReplace.setText( ((TextView)v).getText() ); rlHolder.addView( etReplace, rlpParams ); break; } } } } You can then handle the edit and either hide or remove the EditText, set the TextView text to the new text, and make the TextView visible again. Steven Studio-LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Thanks for your reply, but in my real application I have two nested LinearLayout which make up a table. This table is comprised of CustomEditText, so your solution isn't appliable here. I appreciate your effort, but I need a solution based on the above pattern. I also tried to use a ViewSwitcher to switch between a TextView and an EditText, but it seems a performance hit, since I have a 7x7 table and so I need to instantiate 49 ViewSwitcher besides the 49 TextViews and 49 EditText 2011/10/7 Studio LFP studio@gmail.com Here is something I came up. I haven't worked out all the details, but maybe this will get you started. It works by using a RelativeLayout and when you tap on a TextView, it just sets the bounds of an EditText to match the TextView. It then hides the TextView and layers the EditText on the invisible view. I know I didn't handle the click-change-color and long-click-change-view idea, but these should be fairly easy to add. XML Layout: swap_view.xml --- ?xml version=1.0 encoding=utf-8? RelativeLayout android:id=@+id/rlHolder xmlns:android= http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent TextView android:id=@+id/tvReplace android:layout_width=match_parent android:layout_height=40dp android:text=Test Text android:textSize=20dp / /RelativeLayout Activity Code public class SwapViewActivity extends Activity implements OnClickListener { private RelativeLayout rlHolder; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView( R.layout.swap_view ); rlHolder = (RelativeLayout)findViewById( R.id.rlHolder ); TextView tvReplace = (TextView)findViewById( R.id.tvReplace ); tvReplace.setOnClickListener( this ); } @Override public void onClick( View v ) { switch( v.getId() ) { case R.id.tvReplace: { RelativeLayout.LayoutParams rlpParams = new RelativeLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); rlpParams.addRule( RelativeLayout.ALIGN_LEFT, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_TOP, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_RIGHT, v.getId() ); rlpParams.addRule( RelativeLayout.ALIGN_BOTTOM, v.getId() ); v.setVisibility( View.INVISIBLE ); EditText etReplace = new EditText( this ); etReplace.setText( ((TextView)v).getText() ); rlHolder.addView( etReplace, rlpParams ); break; } } } } You can then handle the edit and either hide or remove the EditText, set the TextView text to the new text, and make the TextView visible again. Steven Studio-LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
I can't use your code because your technique is only suitable for a RelativeLayout. In a LinearLayout there is no way to stack views and playing with their visibility. Of course, I could take your approach and find a way to have a floating EditText which is exactly over the TextView (ie an overlay) but I won't be able to forward the click event to the newly showed EditText and so the whole thing wouldn't work as designed. Sorry :( Does anybody here know deeply how focus/inupt work with TextViews? 2011/10/7 Studio LFP studio@gmail.com You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Some of the things can be done with drawable state list(s) and stuff. The standard EditText uses a state-list drawable for its background, it can be found under: android-sdk\platforms\platform-X\data\drawable. The name can be found by looking in the platform's styles.xml: style name=Widget.EditText item name=android:focusabletrue/item item name=android:focusableInTouchModetrue/item item name=android:clickabletrue/item item name=android:background@android:drawable/edit_text/item item name=android:textAppearance?android:attr/textAppearanceMediumInverse/item item name=android:textColor@android:color/primary_text_light/item item name=android:gravitycenter_vertical/item /style So it's drawable/edit_text.xml you want. It should be possible to create a similar background state-list XML, to be transparent (or white without the border) for when the EditText is not focused. As for the rest of you requirements, including a long press to enter editing... I believe - as a user - that UIs should be predictable and consistent with the platform's conventions, but maybe I'm just too old for this mobile computing thing :) -- Kostya 07.10.2011 20:29, Studio LFP пишет: You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Hi Kostya, you must be the author of WiFi manager :) Nice to meet you The problem here is not about visual appearance, it's about EditText behavior :) I agree that UIs should be as intuitive as possible, so I can make you an example of what I want to implement. Imagine to have a 7x7 table of TextViews. Obviously the cells are little and the text is ellipsized. I want that when the user taps a cell, a bigger popup displays more information, and when the user long taps the cell, he can directly edit the text in it. I think it's a good design but anyway once the app is out, users will judge it :) I need to know more about how focus is managed on Android platform. Here are some questions 1. Is there ALWAYS a focused element? Or can the focus be empty? 2. How does the soft keyboard relate to the focus? 2011/10/7 Kostya Vasilyev kmans...@gmail.com Some of the things can be done with drawable state list(s) and stuff. The standard EditText uses a state-list drawable for its background, it can be found under: android-sdk\platforms\**platform-X\data\drawable. The name can be found by looking in the platform's styles.xml: style name=Widget.EditText item name=android:focusabletrue**/item item name=android:**focusableInTouchModetrue/**item item name=android:clickabletrue**/item item name=android:background@**android:drawable/edit_text/**item item name=android:textAppearance**?android:attr/** textAppearanceMediumInverse/**item item name=android:textColor@**android:color/primary_text_** light/item item name=android:gravitycenter_**vertical/item /style So it's drawable/edit_text.xml you want. It should be possible to create a similar background state-list XML, to be transparent (or white without the border) for when the EditText is not focused. As for the rest of you requirements, including a long press to enter editing... I believe - as a user - that UIs should be predictable and consistent with the platform's conventions, but maybe I'm just too old for this mobile computing thing :) -- Kostya 07.10.2011 20:29, Studio LFP пишет: You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@**googlegroups.comandroid-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Using a simple technique, and should be usable anywhere. ?xml version=1.0 encoding=utf-8? RelativeLayout android:id=@+id/rlHolder xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent com.testproject.views.SwapView android:id=@+id/svReplace android:layout_width=match_parent android:layout_height=40dp android:text=Test Text android:textSize=20dp / /RelativeLayout public class SwapView extends LinearLayout { public static final int TYPE_TEXT = 0; public static final int TYPE_EDIT = 1; public int iType = 0; public String sText = Text; private LinearLayout.LayoutParams llpParams = new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); private Context context; public SwapView(Context newContext) { super(newContext); context = newContext; setInitialView(); } public SwapView(Context newContext, AttributeSet attrs) { super(newContext, attrs); context = newContext; setInitialView(); } private void setInitialView() { TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); } public void setActiveType( int iNewType ) { this.removeAllViews(); iType = iNewType; switch( iNewType ) { case TYPE_TEXT: TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); break; case TYPE_EDIT: EditText etNew = new EditText( context ); etNew.setText( sText ); addView( etNew, llpParams ); break; } } } Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Along with the above code you could add an Ok button to the side of the edit text to accept the input and revert back to a TextView. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 12:02:52 PM UTC-5, Studio LFP wrote: Using a simple technique, and should be usable anywhere. ?xml version=1.0 encoding=utf-8? RelativeLayout android:id=@+id/rlHolder xmlns:android= http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent com.testproject.views.SwapView android:id=@+id/svReplace android:layout_width=match_parent android:layout_height=40dp android:text=Test Text android:textSize=20dp / /RelativeLayout public class SwapView extends LinearLayout { public static final int TYPE_TEXT = 0; public static final int TYPE_EDIT = 1; public int iType = 0; public String sText = Text; private LinearLayout.LayoutParams llpParams = new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); private Context context; public SwapView(Context newContext) { super(newContext); context = newContext; setInitialView(); } public SwapView(Context newContext, AttributeSet attrs) { super(newContext, attrs); context = newContext; setInitialView(); } private void setInitialView() { TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); } public void setActiveType( int iNewType ) { this.removeAllViews(); iType = iNewType; switch( iNewType ) { case TYPE_TEXT: TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); break; case TYPE_EDIT: EditText etNew = new EditText( context ); etNew.setText( sText ); addView( etNew, llpParams ); break; } } } Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
I already told you that I tried a similar approach with a ViewSwitcher. There is no need to extend a LinearLayout for this task if there is a pre built ViewSwitcher. The problem with this pattern is that the user click is eaten by the SwapView, so the user has to click another time in the EditText to focus it and show the soft keyboard. I want that when the user long taps my custom view, a soft keyboard is shown if necessary and he can start typing (without having to click it one more time) 2011/10/7 Studio LFP studio@gmail.com Along with the above code you could add an Ok button to the side of the edit text to accept the input and revert back to a TextView. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 12:02:52 PM UTC-5, Studio LFP wrote: Using a simple technique, and should be usable anywhere. ?xml version=1.0 encoding=utf-8? RelativeLayout android:id=@+id/rlHolder xmlns:android=http://schemas. **android.com/apk/res/androidhttp://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=match_**parent android:layout_height=match_**parent com.testproject.views.**SwapView android:id=@+id/svReplace android:layout_width=match_**parent android:layout_height=40dp android:text=Test Text android:textSize=20dp / /RelativeLayout public class SwapView extends LinearLayout { public static final int TYPE_TEXT = 0; public static final int TYPE_EDIT = 1; public int iType = 0; public String sText = Text; private LinearLayout.LayoutParams llpParams = new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); private Context context; public SwapView(Context newContext) { super(newContext); context = newContext; setInitialView(); } public SwapView(Context newContext, AttributeSet attrs) { super(newContext, attrs); context = newContext; setInitialView(); } private void setInitialView() { TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); } public void setActiveType( int iNewType ) { this.removeAllViews(); iType = iNewType; switch( iNewType ) { case TYPE_TEXT: TextView tvNew = new TextView( context ); tvNew.setText( sText ); addView( tvNew, llpParams ); break; case TYPE_EDIT: EditText etNew = new EditText( context ); etNew.setText( sText ); addView( etNew, llpParams ); break; } } } Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
etNew.requestFocus(); InputMethodManager mgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput( etNew, InputMethodManager.SHOW_IMPLICIT ); There, add that to the case: TYPE_EDIT before the break and your done. And yes, there is a reason to make your own. It's easier, faster and is more configurable because you can control every detail. Ignore help if you want, but I don't think anyone here is going to write all the details for you. We are here to point people in the right direction and for them to fill in the details. There are still details that are needed to make that fully functional, but they are easy because you have infinite control in your own class. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
07.10.2011 21:01, Raffaele Sgarro пишет: Hi Kostya, you must be the author of WiFi manager :) Nice to meet you I am. Just wanted a little widget for myself, then it kind of went out of control :) The problem here is not about visual appearance, it's about EditText behavior :) I agree that UIs should be as intuitive as possible, so I can make you an example of what I want to implement. Imagine to have a 7x7 table of TextViews. Obviously the cells are little and the text is ellipsized. I want that when the user taps a cell, a bigger popup displays more information, and when the user long taps the cell, he can directly edit the text in it. I think it's a good design but anyway once the app is out, users will judge it :) Ah, so it's a spreadsheet type thing. Understand. Well, in that case, I wouldn't try to create a switchable two-in-one widget. I'd just create an EditText somewhere in the layout, initially hidden, and position and show it over a cell when needed, then hide (when detecting a click on another cell). To do this, you'd need to watch click events for all text cells, and keep track of which one you're currently editing. As far as positioning goes, you could add just one RelativeLayout in the entire content hierarchy specifically for this, or (probably) use a PopupWindow, it has an option to hide automatically when there is a click outside of its boundaries. I would let EditText use its default font size so it's more familiar to the user, and position it centered over the cell. The IME should show if you requestFocus() on the EditText, or else you can use this: http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#showSoftInput(android.view.View, int) http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#showSoftInput%28android.view.View,%20int%29 -- Kostya I need to know more about how focus is managed on Android platform. Here are some questions 1. Is there ALWAYS a focused element? Or can the focus be empty? 2. How does the soft keyboard relate to the focus? 2011/10/7 Kostya Vasilyev kmans...@gmail.com mailto:kmans...@gmail.com Some of the things can be done with drawable state list(s) and stuff. The standard EditText uses a state-list drawable for its background, it can be found under: android-sdk\platforms\platform-X\data\drawable. The name can be found by looking in the platform's styles.xml: style name=Widget.EditText item name=android:focusabletrue/item item name=android:focusableInTouchModetrue/item item name=android:clickabletrue/item item name=android:background@android:drawable/edit_text/item item name=android:textAppearance?android:attr/textAppearanceMediumInverse/item item name=android:textColor@android:color/primary_text_light/item item name=android:gravitycenter_vertical/item /style So it's drawable/edit_text.xml you want. It should be possible to create a similar background state-list XML, to be transparent (or white without the border) for when the EditText is not focused. As for the rest of you requirements, including a long press to enter editing... I believe - as a user - that UIs should be predictable and consistent with the platform's conventions, but maybe I'm just too old for this mobile computing thing :) -- Kostya 07.10.2011 20:29, Studio LFP пишет: You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com
Re: [android-developers] Re: EditText with custom behavior
Sorry Steven, I didn't mean to hurt you I appreciate your help a lot, you are the only one which actually coded something, and I believe this is very valuable. The layout approach was my first attempt, but I'm working on something cleaner and I think I have finally found a solution, which I'll post here so someone can test it and see if it works as expected. 2011/10/7 Studio LFP studio@gmail.com etNew.requestFocus(); InputMethodManager mgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput( etNew, InputMethodManager.SHOW_IMPLICIT ); There, add that to the case: TYPE_EDIT before the break and your done. And yes, there is a reason to make your own. It's easier, faster and is more configurable because you can control every detail. Ignore help if you want, but I don't think anyone here is going to write all the details for you. We are here to point people in the right direction and for them to fill in the details. There are still details that are needed to make that fully functional, but they are easy because you have infinite control in your own class. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Here is the whole Eclipse projecthttp://www.2shared.com/file/us3MXMdS/custom-edit-text.html? After more than 6 hours working on this, I finally found a solution. It's simpler than what I thought. The key point is using setFocusable()and setFocusableInTouchMode() at the right moments, and manually showing and hiding the soft keyboard. I hope you download the sample and execute it, so I can have a reasonable feedback. There is also a little onKeyPreIme() invocation which causes the custom view to clear its state when the user manually hides the soft keyboard by pressing the return key. Thanks to all of you 2011/10/7 Raffaele Sgarro raffaelesga...@gmail.com Sorry Steven, I didn't mean to hurt you I appreciate your help a lot, you are the only one which actually coded something, and I believe this is very valuable. The layout approach was my first attempt, but I'm working on something cleaner and I think I have finally found a solution, which I'll post here so someone can test it and see if it works as expected. 2011/10/7 Studio LFP studio@gmail.com etNew.requestFocus(); InputMethodManager mgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput( etNew, InputMethodManager.SHOW_IMPLICIT ); There, add that to the case: TYPE_EDIT before the break and your done. And yes, there is a reason to make your own. It's easier, faster and is more configurable because you can control every detail. Ignore help if you want, but I don't think anyone here is going to write all the details for you. We are here to point people in the right direction and for them to fill in the details. There are still details that are needed to make that fully functional, but they are easy because you have infinite control in your own class. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
I'm not hurt by you choosing to go a different path. Just seems like you are leaving a lot on the table that's already written for you by trying to put a square peg into a round hole. I checked out that project and I think you are cutting yourself short here because of the following: 1. Now you have to write a full select/copy/paste routine since you've overridden it by catching the long click 2. You don't give a defined space so the user understands the bounds of the view 3. Touching to place the cursor somewhere causes it to keep editing and leaves the cursor there, but dismiss the keyboard I only tested it a little, so I'm not sure what other issues might pop up as you use it more. You may also want to find a place for android:imeOptions=flagNoExtractUi (or similar in code) so that it doesn't popup the full UI of the keyboard in landscape mode so it still feels like you are editing in place. And a android:configChanges=orientation|keyboardHidden on your activity because it resets your views on rotate otherwise. It seems like you are actually causing more work for yourself, but if it's working like you want it to, then that's what matters. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 1:48:57 PM UTC-5, Raffaele Sgarro wrote: Here is the whole Eclipse projecthttp://www.2shared.com/file/us3MXMdS/custom-edit-text.html? After more than 6 hours working on this, I finally found a solution. It's simpler than what I thought. The key point is using setFocusable()and setFocusableInTouchMode() at the right moments, and manually showing and hiding the soft keyboard. I hope you download the sample and execute it, so I can have a reasonable feedback. There is also a little onKeyPreIme() invocation which causes the custom view to clear its state when the user manually hides the soft keyboard by pressing the return key. Thanks to all of you 2011/10/7 Raffaele Sgarro raffael...@gmail.com Sorry Steven, I didn't mean to hurt you I appreciate your help a lot, you are the only one which actually coded something, and I believe this is very valuable. The layout approach was my first attempt, but I'm working on something cleaner and I think I have finally found a solution, which I'll post here so someone can test it and see if it works as expected. 2011/10/7 Studio LFP studi...@gmail.com etNew.requestFocus(); InputMethodManager mgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput( etNew, InputMethodManager.SHOW_IMPLICIT ); There, add that to the case: TYPE_EDIT before the break and your done. And yes, there is a reason to make your own. It's easier, faster and is more configurable because you can control every detail. Ignore help if you want, but I don't think anyone here is going to write all the details for you. We are here to point people in the right direction and for them to fill in the details. There are still details that are needed to make that fully functional, but they are easy because you have infinite control in your own class. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Unfortunately I can't give you my actual app's code, but #1 and #2 are not issues since they are intended :) #3 seems a bug instead. Can you please describe carefully what are the steps to reproduce it? Also the Android runtime version could matter. I can't reproduce that behavior. Thanks for your support 2011/10/7 Studio LFP studio@gmail.com I'm not hurt by you choosing to go a different path. Just seems like you are leaving a lot on the table that's already written for you by trying to put a square peg into a round hole. I checked out that project and I think you are cutting yourself short here because of the following: 1. Now you have to write a full select/copy/paste routine since you've overridden it by catching the long click 2. You don't give a defined space so the user understands the bounds of the view 3. Touching to place the cursor somewhere causes it to keep editing and leaves the cursor there, but dismiss the keyboard I only tested it a little, so I'm not sure what other issues might pop up as you use it more. You may also want to find a place for android:imeOptions=flagNoExtractUi (or similar in code) so that it doesn't popup the full UI of the keyboard in landscape mode so it still feels like you are editing in place. And a android:configChanges=orientation|keyboardHidden on your activity because it resets your views on rotate otherwise. It seems like you are actually causing more work for yourself, but if it's working like you want it to, then that's what matters. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 1:48:57 PM UTC-5, Raffaele Sgarro wrote: Here is the whole Eclipse projecthttp://www.2shared.com/file/us3MXMdS/custom-edit-text.html? After more than 6 hours working on this, I finally found a solution. It's simpler than what I thought. The key point is using setFocusable()and setFocusableInTouchMode() at the right moments, and manually showing and hiding the soft keyboard. I hope you download the sample and execute it, so I can have a reasonable feedback. There is also a little onKeyPreIme() invocation which causes the custom view to clear its state when the user manually hides the soft keyboard by pressing the return key. Thanks to all of you 2011/10/7 Raffaele Sgarro raffael...@gmail.com Sorry Steven, I didn't mean to hurt you I appreciate your help a lot, you are the only one which actually coded something, and I believe this is very valuable. The layout approach was my first attempt, but I'm working on something cleaner and I think I have finally found a solution, which I'll post here so someone can test it and see if it works as expected. 2011/10/7 Studio LFP studi...@gmail.com etNew.requestFocus(); InputMethodManager mgr = (InputMethodManager) context.getSystemService( **Context.INPUT_METHOD_SERVICE); mgr.showSoftInput( etNew, InputMethodManager.SHOW_**IMPLICIT ); There, add that to the case: TYPE_EDIT before the break and your done. And yes, there is a reason to make your own. It's easier, faster and is more configurable because you can control every detail. Ignore help if you want, but I don't think anyone here is going to write all the details for you. We are here to point people in the right direction and for them to fill in the details. There are still details that are needed to make that fully functional, but they are easy because you have infinite control in your own class. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
I tested it on the following: Xperia Play - Android 2.3.2 Samsung Galaxy Tab (7 in) - Android 2.2 Motorola Droid (Original) - Android 2.2.2 Droid Bionic - Android 2.3.4 HTC Hero - Androi 2.1-update 1 My Xoom is out for the LTE upgrade so I can't test it on that at the moment. It only worked correctly on the HTC Hero. All others the keyboard poofs when you move the cursor by touch somewhere else in the EditText. The Xperia Play acted a bit more weird than the others and allowed me to select text, but not be able to cancel the select and place the cursor where I wanted it. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Oh my god, it's a mess!!! But still I don't understand exactly what happens. I think you do something like 1. Long tap on a view: this shows the soft keyboard and you can type anything 2. Click on the same view: this triggers the mess Is this right? Is the problem when you click in the current focused EditText? Otherwise it goes well 2011/10/7 Studio LFP studio@gmail.com I tested it on the following: Xperia Play - Android 2.3.2 Samsung Galaxy Tab (7 in) - Android 2.2 Motorola Droid (Original) - Android 2.2.2 Droid Bionic - Android 2.3.4 HTC Hero - Androi 2.1-update 1 My Xoom is out for the LTE upgrade so I can't test it on that at the moment. It only worked correctly on the HTC Hero. All others the keyboard poofs when you move the cursor by touch somewhere else in the EditText. The Xperia Play acted a bit more weird than the others and allowed me to select text, but not be able to cancel the select and place the cursor where I wanted it. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Exactly. When I try to touch to move the cursor in an already focused box, the keyboard dismisses on everything but the HTC Hero on 2.1-update 1. The Xperia Play goes into some kind of select text mode the others don't. You may have to check if the view that is clicked on is the one the user is currently editing and prevent this behavior. I can post screen shots in a bit if you need them. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 4:22:06 PM UTC-5, Raffaele Sgarro wrote: Oh my god, it's a mess!!! But still I don't understand exactly what happens. I think you do something like 1. Long tap on a view: this shows the soft keyboard and you can type anything 2. Click on the same view: this triggers the mess Is this right? Is the problem when you click in the current focused EditText? Otherwise it goes well 2011/10/7 Studio LFP studi...@gmail.com I tested it on the following: Xperia Play - Android 2.3.2 Samsung Galaxy Tab (7 in) - Android 2.2 Motorola Droid (Original) - Android 2.2.2 Droid Bionic - Android 2.3.4 HTC Hero - Androi 2.1-update 1 My Xoom is out for the LTE upgrade so I can't test it on that at the moment. It only worked correctly on the HTC Hero. All others the keyboard poofs when you move the cursor by touch somewhere else in the EditText. The Xperia Play acted a bit more weird than the others and allowed me to select text, but not be able to cancel the select and place the cursor where I wanted it. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Please, try adding this little patch at line 23 if (mLastTapped == arg0) return; This should be enough 2011/10/7 Studio LFP studio@gmail.com Exactly. When I try to touch to move the cursor in an already focused box, the keyboard dismisses on everything but the HTC Hero on 2.1-update 1. The Xperia Play goes into some kind of select text mode the others don't. You may have to check if the view that is clicked on is the one the user is currently editing and prevent this behavior. I can post screen shots in a bit if you need them. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 4:22:06 PM UTC-5, Raffaele Sgarro wrote: Oh my god, it's a mess!!! But still I don't understand exactly what happens. I think you do something like 1. Long tap on a view: this shows the soft keyboard and you can type anything 2. Click on the same view: this triggers the mess Is this right? Is the problem when you click in the current focused EditText? Otherwise it goes well 2011/10/7 Studio LFP studi...@gmail.com I tested it on the following: Xperia Play - Android 2.3.2 Samsung Galaxy Tab (7 in) - Android 2.2 Motorola Droid (Original) - Android 2.2.2 Droid Bionic - Android 2.3.4 HTC Hero - Androi 2.1-update 1 My Xoom is out for the LTE upgrade so I can't test it on that at the moment. It only worked correctly on the HTC Hero. All others the keyboard poofs when you move the cursor by touch somewhere else in the EditText. The Xperia Play acted a bit more weird than the others and allowed me to select text, but not be able to cancel the select and place the cursor where I wanted it. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
That worked for all but the Xperia Play. It still selects everything and doesn't let me place a cursor where I want it. You will need to clear that at some point because it prevents clicking on the same view again. This could be bad if the phone goes to sleep or another activity comes up and then they go back to yours. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
I really cannot understand what's going on :S The XPeria is the only phone with the hard keyword, isn't it? But if I try in the emulator (which also emulates a hardware keyboard) everything goes fine. I mean, when you long click a View all text is selected (intended, so one can easily erase everything) and I can move the cursor wherever I want, either by clicking and moving the Dpad. Can you give more information? 2011/10/8 Studio LFP studio@gmail.com That worked for all but the Xperia Play. It still selects everything and doesn't let me place a cursor where I want it. You will need to clear that at some point because it prevents clicking on the same view again. This could be bad if the phone goes to sleep or another activity comes up and then they go back to yours. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with custom behavior
Ok, I played with it and got it to work. On the Xperia Play (which has a hardware game pad not a hardware keyboard), the problem is it starts with all the text selected so you can't touch anywhere to move the cursor. You need to move the selection handles to unselect part of the text and then touch in the unselected part of the text to get the cursor to move there. It's a major pain and wouldn't be very fun for your users. Steven Studio LFP http://www.studio-lfp.com On Friday, October 7, 2011 5:14:50 PM UTC-5, Raffaele Sgarro wrote: I really cannot understand what's going on :S The XPeria is the only phone with the hard keyword, isn't it? But if I try in the emulator (which also emulates a hardware keyboard) everything goes fine. I mean, when you long click a View all text is selected (intended, so one can easily erase everything) and I can move the cursor wherever I want, either by clicking and moving the Dpad. Can you give more information? 2011/10/8 Studio LFP studi...@gmail.com That worked for all but the Xperia Play. It still selects everything and doesn't let me place a cursor where I want it. You will need to clear that at some point because it prevents clicking on the same view again. This could be bad if the phone goes to sleep or another activity comes up and then they go back to yours. Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText and the unwanted Quick Search Box
Hello Alvaro, I'm glad you got this worked out. This whole thing with the Edit Text is weird in so many ways. Like you I ended up getting around it after a lot of trial and error. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
I'm facing the same problem here, but under different circumstances. I've also a standard and simple EditText, but my Avtivity does not have any special behaviour. At first, it's superclass implemented OnClickListener, which was overridden by the activity, and we removed that. Each callback function was created as an Anonymous inner-type, and things got working. At least for 30 min, then the bug showed up again. I tried your approach of using an AsyncTask, but as most of the initialization code is related to UI, it could not run in another thread. Even with the remaining code left on the task, the problem persisted. Have anybody else crossed this problem and got it solved? Oh, and the device we're using is the Galaxy S II. All the best -Alvaro. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText and the unwanted Quick Search Box
Problem fixed, although I have no idea why it was yielding this error. On my code I was initializing a progress dialog as follows: dialogWait = ProgressDialog.show(*this*, , getResources().getString(R.string.msg_please_wait), *true*, *true*); dialogWait.setOnCancelListener(*new* OnCancelListener() { @Override *public* *void* onCancel(DialogInterface dialog) { Log.d(FileSystemService.LOG_TAG, onCancel()); remoteTask.cancel(*true*); setButtonsEnabled(*true*); } }); dialogWait.hide(); I found out that the highlighted line was the problem after commenting all the code, and then uncommenting line per line. I changed the initialization of the dialog to a more standard one: dialogWait = new ProgressDialog(this); dialogWait.setTitle(); dialogWait.setMessage(getResources().getString(R.string.msg_please_wait)); dialogWait.setCancelable(true); dialogWait.setIndeterminate(true); And everything was fine. Hope it helps. :o) On Wed, Oct 5, 2011 at 2:43 PM, Alvaro Victor Cavalcanti alvarovic...@gmail.com wrote: I'm facing the same problem here, but under different circumstances. I've also a standard and simple EditText, but my Avtivity does not have any special behaviour. At first, it's superclass implemented OnClickListener, which was overridden by the activity, and we removed that. Each callback function was created as an Anonymous inner-type, and things got working. At least for 30 min, then the bug showed up again. I tried your approach of using an AsyncTask, but as most of the initialization code is related to UI, it could not run in another thread. Even with the remaining code left on the task, the problem persisted. Have anybody else crossed this problem and got it solved? Oh, and the device we're using is the Galaxy S II. All the best -Alvaro. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Alvaro Victor Cavalcanti [e-mail/chat] alvarovic...@gmail.com [skype] alvarovictor [twitter] alvarocavalcant Systems Engineer / Aspiring Game Designer -- Loodo - Um blog sobre Jogos e Game Design www.loodo.com.br -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText with tiled background
Hi , Can anyone share working customseekbar example please Thanks in Advance.. On Thu, Sep 8, 2011 at 7:48 PM, Richard Lalancette richard.lalance...@gmail.com wrote: You can create an xml file for your background. In that XML file, you add an item called bitmap. On the bitmap item, you apply a PNG that can tile and set the tile mode to repeat. Example found here http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/ ?xml version=1.0 encoding=utf-8? layer-list xmlns:android=http://schemas.android.com/apk/res/ android item clip shape gradient android:startColor=#FF5e8ea3 android:centerColor=#FF32a0d2 android:centerY=0.1 android:endColor=#FF13729e android:angle=270 / /shape /clip /item item clip bitmap xmlns:android=http://schemas.android.com/apk/res/ android android:src=@drawable/stripe_bg android:tileMode=repeat android:antialias=true android:dither=false android:filter=false android:gravity=left / /clip /item /layer-list Don't hesitate to grab 9-patch PNGs from my blog if you need :) android9patch.blogspot.com Richard. On Sep 7, 4:10 pm, Vladyslav Chyzhevskyi chyzhevs...@gmail.com wrote: Hi everyone! I tried to create EditText element with tiled background. I use 9-patch, but this scratch image for whole edit area, rather I want to repeat it, look like in picture below. https://lh4.googleusercontent.com/-4GC8DxBbmFs/TmfPKDk0GmI/AC.. . How I can do this? Any ideas? Thx a lot. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText with tiled background
You can create an xml file for your background. In that XML file, you add an item called bitmap. On the bitmap item, you apply a PNG that can tile and set the tile mode to repeat. Example found here http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/ ?xml version=1.0 encoding=utf-8? layer-list xmlns:android=http://schemas.android.com/apk/res/ android item clip shape gradient android:startColor=#FF5e8ea3 android:centerColor=#FF32a0d2 android:centerY=0.1 android:endColor=#FF13729e android:angle=270 / /shape /clip /item item clip bitmap xmlns:android=http://schemas.android.com/apk/res/ android android:src=@drawable/stripe_bg android:tileMode=repeat android:antialias=true android:dither=false android:filter=false android:gravity=left / /clip /item /layer-list Don't hesitate to grab 9-patch PNGs from my blog if you need :) android9patch.blogspot.com Richard. On Sep 7, 4:10 pm, Vladyslav Chyzhevskyi chyzhevs...@gmail.com wrote: Hi everyone! I tried to create EditText element with tiled background. I use 9-patch, but this scratch image for whole edit area, rather I want to repeat it, look like in picture below. https://lh4.googleusercontent.com/-4GC8DxBbmFs/TmfPKDk0GmI/AC... How I can do this? Any ideas? Thx a lot. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText box doesn't work the same way in PopupWindow as in AlertDialog
I've noticed this behavior in the built-in Android apps as well, sometimes you cannot long tap on fields.I think it's probably a bug. On Aug 27, 4:50 am, Frank frank.android@gmail.com wrote: Hi Dan, Actually, the PopupWindow was made focusable. I can tap on EditText and use the keyboard to input text. But just the long press/double tap won't select any text. Frank On Aug 26, 12:19 pm, IcedNet d...@icednet.info wrote: http://developer.android.com/reference/android/widget/PopupWindow.html Depending on how it is instantiated, it may be non-focusable by default... Peace, Dan On Aug 26, 1:09 pm, Frank frank.android@gmail.com wrote: Dear All, I am having some difficulty getting an EditText widget work properly in a PopupWindow class. When it is used in a PopupWindow and double clicked/long pressed, nothing happens. However, when it is put in an AlertDialog, double click selects the text in it and brings up a built-in text tool bar at the top. Does anyone know the cause of this? Thank you very much. Regards, Frank- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText box doesn't work the same way in PopupWindow as in AlertDialog
http://developer.android.com/reference/android/widget/PopupWindow.html Depending on how it is instantiated, it may be non-focusable by default... Peace, Dan On Aug 26, 1:09 pm, Frank frank.android@gmail.com wrote: Dear All, I am having some difficulty getting an EditText widget work properly in a PopupWindow class. When it is used in a PopupWindow and double clicked/long pressed, nothing happens. However, when it is put in an AlertDialog, double click selects the text in it and brings up a built-in text tool bar at the top. Does anyone know the cause of this? Thank you very much. Regards, Frank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText box doesn't work the same way in PopupWindow as in AlertDialog
Hi Dan, Actually, the PopupWindow was made focusable. I can tap on EditText and use the keyboard to input text. But just the long press/double tap won't select any text. Frank On Aug 26, 12:19 pm, IcedNet d...@icednet.info wrote: http://developer.android.com/reference/android/widget/PopupWindow.html Depending on how it is instantiated, it may be non-focusable by default... Peace, Dan On Aug 26, 1:09 pm, Frank frank.android@gmail.com wrote: Dear All, I am having some difficulty getting an EditText widget work properly in a PopupWindow class. When it is used in a PopupWindow and double clicked/long pressed, nothing happens. However, when it is put in an AlertDialog, double click selects the text in it and brings up a built-in text tool bar at the top. Does anyone know the cause of this? Thank you very much. Regards, Frank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText text validation
It sounds like you need a focus change listener. http://developer.android.com/reference/android/view/View.OnFocusChangeListener.html On Aug 9, 12:36 am, yoav bbb yoav...@gmail.com wrote: So. The validate function must be called when ressing a button? no option to call the function when user leaves the textbox - to the backgour or to another control? On 9 אוגוסט, 06:24, TreKing treking...@gmail.com wrote: On Sun, Aug 7, 2011 at 10:57 PM, yoav bbb yoav...@gmail.com wrote: Where is the hook for the validate function? There isn't one, AFAIK. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText text validation
So. The validate function must be called when ressing a button? no option to call the function when user leaves the textbox - to the backgour or to another control? On 9 אוגוסט, 06:24, TreKing treking...@gmail.com wrote: On Sun, Aug 7, 2011 at 10:57 PM, yoav bbb yoav...@gmail.com wrote: Where is the hook for the validate function? There isn't one, AFAIK. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
I believe that I've come up with a work-around - at least in my case. I don't know why this works, but the problem hasn't reappeared in the last month after making these changes. The app has TTS and Voice Recognition. I was doing all the setup by creating an asynctask from the onCreate of the main activity. In an act of pure desperation, I moved the instantiation of the asynctask into a runnable that I executed with delay of approx 100ms. I have no idea why this worked, but apparently the create was able to finish and whatever was confusing the EditText seems to have gone away. While I'm not confident that this will work in all cases (or if I just got lucky), if you are still having difficulty, try moving whatever system altering/registering tasks otherwise done in the onCreate and see if that helps. While the following code snippets aren't going to be particularly relevant to your app, I'm including them for the sake of example. * At the end of onCreate* // Feeble Attempt to fix google qsb issue Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { new InitialLoads().execute(); } }, 100); * The AsyncTask that gets called * private class InitialLoads extends AsyncTaskVoid, Void, Void { @@Override protected Void doInBackground(Void... arg0) { PackageManager pm = getPackageManager(); /* establish whether the TextToSpeech class is available to us */ // static { try { WrapTTS.checkAvailable(); mTTSClassAvailable = true; } catch (Throwable t) { mTTSClassAvailable = false; } // } if (mTTSClassAvailable) { Intent checkIntent = new Intent(); checkIntent .setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); // Check intent to make sure TTS can be satisfied. Then start // the activity if it is OK to proceed. ResolveInfo resolveInfo = pm.resolveActivity(checkIntent, PackageManager.MATCH_DEFAULT_ONLY); if (resolveInfo == null) { // Not able to find the activity which should be started for // this intent } else { startActivityForResult(checkIntent, REQUEST_TTSOK); } } // Check to see if a recognition activity is present ListResolveInfo activities = pm.queryIntentActivities(new Intent( RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mVoiceAvailable = activities.size() 0; if (!Constants.IsProduction) { // Force voice available on the emulators mVoiceAvailable = true; } // For use with preference screen AdvPreferences.INSTANCE.setVoiceAvailable(mVoiceAvailable); return null; } } Best of Luck. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
OK, did that and listed a couple of Web references from last year that appear to be the same problem. Chuck -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
Hello e2gGuy, I would encourage you to check out the issue I submitted: http://code.google.com/p/android/issues/list Search for issue 17508. Please add a comment with any additional information you may have and Star it. So far it doesn't appear to have been noticed. Thank you. Best Regards, Eric -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
I'd like to add one more device that demos this problem -- Samsung Intercept running 2.2.2. I have an EditText with onKey method used repeatedly to enter data in a grid. After some random number of inputs stops displaying anything in the EditText, but data is entered OK in the grid. Sure would like to see a good workaround for this one. I haven't been able to produce problem with the emulator, but maybe didn't try enough inputs. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
Thank you for your suggestion. I gave it a shot and could still reproduce the issue. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
Looks great, starred it. :-) On Jun 8, 6:02 pm, Eric Carman ewcarma...@gmail.com wrote: I've submitted a bug report. I don't know what to do about going further with this. I setup an inherited class so that I could throw some logging into the EditText in hopes of finding a pattern or blip. No joy. Bug: 17508 Please feel free to elaborate or correct anything I might have said. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText stops displaying characters as I'm typing?
What happens if you re-assign it for example: EditText ed=(EditText)findViewById(R.id.editText1); ed.setText(xnumber); and simple re-load the .setText ? Just a thought? On 10/06/2011, Ben S accu...@gmail.com wrote: Looks great, starred it. :-) On Jun 8, 6:02 pm, Eric Carman ewcarma...@gmail.com wrote: I've submitted a bug report. I don't know what to do about going further with this. I setup an inherited class so that I could throw some logging into the EditText in hopes of finding a pattern or blip. No joy. Bug: 17508 Please feel free to elaborate or correct anything I might have said. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
I've submitted a bug report. I don't know what to do about going further with this. I setup an inherited class so that I could throw some logging into the EditText in hopes of finding a pattern or blip. No joy. Bug: 17508 Please feel free to elaborate or correct anything I might have said. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
The following extracts from IInputConnectionWrapper shed a little light on this - no solution, but a little light. This appears to be the area where the error is occurring. As such, either the mInputConnection is returning null or the isActive method is returning false case DO_END_BATCH_EDIT: { InputConnection ic = mInputConnection.get(); if (ic == null || !isActive()) { Log.w(TAG, endBatchEdit on inactive InputConnection); return; } ic.endBatchEdit(); return; } but, public boolean isActive() { return true; } For some reason the Input Connection appears to be dropped. May I ask, on what OS/Device have you replicated this? I'm seeing this on a G-Slate running 3.0.1. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
I actually looked at that in the Android repository as well...didn't get too deep into it, just as far as you posted. I can replicate the problem personally on a Galaxy S (Fascinate) running 2.2.1, a Nexus One running 2.3.3, and the emulator running 2.1. A couple of friends let me test on their Droid X running 2.2.1, an Adam tablet running 2.2, a Nexus S running 2.3.3, and an original Droid running the latest stock firmware (2.2? maybe). All of those show the problem. I even dropped my emulator down to 1.5 to see if I could replicate the issue and I could. On Jun 7, 5:54 am, Eric Carman ewcarma...@gmail.com wrote: The following extracts from IInputConnectionWrapper shed a little light on this - no solution, but a little light. This appears to be the area where the error is occurring. As such, either the mInputConnection is returning null or the isActive method is returning false case DO_END_BATCH_EDIT: { InputConnection ic = mInputConnection.get(); if (ic == null || !isActive()) { Log.w(TAG, endBatchEdit on inactive InputConnection); return; } ic.endBatchEdit(); return; } but, public boolean isActive() { return true; } For some reason the Input Connection appears to be dropped. May I ask, on what OS/Device have you replicated this? I'm seeing this on a G-Slate running 3.0.1. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
System Logs showing the Quick Search Box being triggered. Here the app begins to be displayed. - 06-06 07:10:54.837: INFO/ActivityManager(96): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x1020 cmp=com.maskeddomain.myproject/.MyActivity } from pid 180 06-06 07:10:54.877: INFO/ActivityManager(96): Start proc com.maskeddomain.myproject for activity com.maskeddomain.myproject/.MyActivity: pid=5013 uid=10046 gids={1015} 06-06 07:10:54.967: VERBOSE/RenderScript_jni(180): surfaceDestroyed 06-06 07:10:54.977: INFO/ActivityManager(96): Starting: Intent { act=android.speech.tts.engine.CHECK_TTS_DATA cmp=com.svox.pico/.CheckVoiceData } from pid 5013 06-06 07:10:55.377: INFO/ActivityManager(96): Start proc com.svox.pico for activity com.svox.pico/.CheckVoiceData: pid=5020 uid=10016 gids={} These items look a little suspicious, but right now I grasping at straws. - 06-06 07:10:55.417: WARN/InputManagerService(96): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub $Proxy@40759888 (uid=10046 pid=5013) 06-06 07:10:55.417: WARN/InputManagerService(96): Client not active, ignoring focus gain of: com.android.internal.view.IInputMethodClient $Stub$Proxy@4073c0c8 06-06 07:10:55.447: INFO/ActivityThread(5020): Pub com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider 06-06 07:10:55.477: INFO/ActivityManager(96): Displayed com.maskeddomain.myproject/.MyActivity: +605ms 06-06 07:10:55.507: INFO/TextToSpeech.java(5013): initTts() successfully bound to service 06-06 07:10:55.507: INFO/ActivityManager(96): Start proc android.tts for service android.tts/.TtsService: pid=5027 uid=10026 gids={3003, 1015} 06-06 07:10:55.527: INFO/ActivityManager(96): No longer want com.android.settings (pid 4730): hidden #16 06-06 07:10:55.567: VERBOSE/TtsService(5027): TtsService.onCreate() 06-06 07:10:55.587: VERBOSE/TtsService(5027): About to load /system/ lib/libttspico.so, applyFilter=true 06-06 07:10:55.597: VERBOSE/TtsService(5027): TtsService.setLanguage(eng, USA, ) 06-06 07:10:55.607: INFO/SVOX Pico Engine(5027): loaded en-US successfully 06-06 07:10:55.607: INFO/SynthProxy(5027): setting speech rate to 100 06-06 07:10:55.627: INFO/TelephonyRegistry(96): notifyServiceState: 0 home T-Mobile T-Mobile 310260 HSDPA CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false 06-06 07:10:55.647: INFO/TelephonyRegistry(96): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=null interfaceName=rmnet0 networkType=8 06-06 07:10:56.097: DEBUG/dalvikvm(4999): GC_CONCURRENT freed 1142K, 50% free 3663K/7239K, external 1625K/2137K, paused 3ms+3ms 06-06 07:10:56.427: INFO/System.out(4999): [INFO:3699]: g: Response [http=200,length=96] 06-06 07:10:56.427: INFO/System.out(4999): [INFO:3703]: g: Read id 1, status code 200 06-06 07:10:56.437: DEBUG/WifiLocator(4999): Too many no-location APs. Will not compute a location nor go to the server. hasLocation=0 noLocation=0 cacheMiss=0 06-06 07:10:56.447: DEBUG/CellLocator(4999): Found cell location: Position [latE7=339212209, lngE7=-843352020, accuracyMm=1046000, confidence=75, levelId=null] 06-06 07:10:56.457: DEBUG/gmmNlpServiceThread(4999): reporting Location[mProvider=network,mTime=1307358656456,mLatitude=33.9212209,mLongitude=-84.335202,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=1046.0,mExtras=Bundle[{networkLocationSource=cached, networkLocationType=cell}]] 06-06 07:11:01.277: INFO/TelephonyRegistry(96): notifyServiceState: 0 home T-Mobile T-Mobile 310260 UMTS CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false 06-06 07:11:01.307: INFO/TelephonyRegistry(96): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=null interfaceName=rmnet0 networkType=3 Here is where the Quick Search Box begins to make an appearance. So, what is calling this intent service? - 06-06 07:11:04.277: INFO/ActivityManager(96): Starting: Intent { act=android.search.action.GLOBAL_SEARCH flg=0x1000 cmp=com.google.android.googlequicksearchbox/.SearchActivity (has extras) } from pid 180 06-06 07:11:04.337: INFO/ActivityManager(96): Start proc com.google.android.googlequicksearchbox for activity com.google.android.googlequicksearchbox/.SearchActivity: pid=5036 uid=10063 gids={3003} 06-06 07:11:04.387: INFO/ActivityManager(96): No longer want com.google.android.apps.uploader (pid 1355): hidden #16 06-06 07:11:04.387: INFO/ActivityManager(96): No longer want com.google.android.apps.maps:BackgroundFriendService (pid 3184): hidden #17 06-06 07:11:04.427: INFO/ActivityThread(5036): Pub com.google.android.googlequicksearchbox.shortcuts: com.google.android.googlequicksearchbox.ShortcutsProvider 06-06 07:11:04.427:
[android-developers] Re: EditText stops displaying characters as I'm typing?
Sorry for the late reply...I've been on vacation. Just before I left I found that any extraneous code I executed within the OnKeyListener would cause the issue to reproduce (I also tried several other callback methods such as onKey, etc. and those produced the same result). If there was any other code I executed (which there was in the ellipsized portion I left out in the OP), the bug could be reproduced quite frequently. There was a bit of code in the portion I left out, but simply calling a method to send the text through a socket or to add that text to a listview adapter would produce the bug. I.e: if (sendText.length() 0) { v.setText(); lvA.add(00:00pm, sendText); //This would cause the edittext to stop functioning normally } I also tried using a handler as well, but found that it wouldn't get rid of the issue. The one thing I have done now to workaround the issue was to remove my OnKeyListener. Instead, what I ended up doing was to add a Send button right next to my EditText, and in its onClickListener I run all of the code I previously ran in my OnKeyListener. Also, I went ahead and set the EditText inputType as textShortMessage (in xml: android:inputType=text|textAutoCorrect| textShortMessage) so that the unused/unmapped enter key on the keyboard would become a smiley key instead. After doing this, I can't replicate the bug. It doesn't solve the underlying issue, but at least it's something. On Jun 5, 2:59 pm, Eric Carman ewcarma...@gmail.com wrote: As this is an on-again, off-again problem, it appears to be on again. I can reproduce this on a G-Slate. Back to square one -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
Thank you for responding Ben. I've also added an Enter key button next to the text view, and may go the route you describe. Right now, I'm still trying to hunt down the root cause if I can. I mean, it's an edit text for crying out loud! This should be simple For a while I thought that perhaps setting the text, as you show above (v.setText();) while in the onKeyListener had something to do with it, but I've trimmed down my listener to the following: EditText.OnKeyListener mOnCommandKeyListener = new EditText.OnKeyListener() { public boolean onKey(View view, int keyCode, KeyEvent event) { boolean result = false; if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_DPAD_CENTER: mHandler.sendEmptyMessage(MSG_TEXT_COMMAND); result = true; break; } } // TODO: Debugging Utilities.errorLog(onCommandKey: KeyCode - + Utilities.translateKeyCode(keyCode, event)); return result; } }; As you can see, there just isn't a lot to it and I've managed to omit any changes to the EditText from within it. But to no avail. I've finally captured a log of this happening. For the sake of trying to track this down, I've added a TextWatcher to do some logging (don't need it otherwise for the app). Here, the log shows me entering the letter o. This displayed in the EditText 06-06 18:30:40.339: ERROR/com.myproject.myactivity(772): TextWatcher: o 06-06 18:30:41.199: ERROR/com.myproject.myactivity(772): onCommandKey: KeyCode - KEYCODE_ENTER 06-06 18:30:41.209: ERROR/com.myproject.myactivity(772): TextWatcher: 06-06 18:30:41.249: ERROR/com.myproject.myactivity(772): onCommandKey: KeyCode - KEYCODE_ENTER 06-06 18:30:41.249: DEBUG/dalvikvm(772): GC_CONCURRENT freed 381K, 9% free 7204K/7879K, paused 3ms+3ms Then, this happened. Whatever has caused this error seems to be at the root of this issue. I've noticed it in the logs before when I've been trying to track this down. This is the first set of logs I have that shows the key entered, and the issue. There is no discernible change to the screen when this happens other than the edit text forgetting to print the characters typed. 06-06 18:30:41.249: WARN/IInputConnectionWrapper(772): endBatchEdit on inactive InputConnection 06-06 18:30:41.279: DEBUG/Tablet/NotificationPanel(185): notificationCount=1 06-06 18:30:41.779: DEBUG/Tablet/NotificationPanel(185): notificationCount=1 Here, the letter p did not show up in the EditText, but it did get saved with the EditText in that getText, etc. could see it as is evidenced by the TextWatcher output. 06-06 18:30:42.219: ERROR/com.myproject.myactivity(772): TextWatcher: p Now I need to research the endBatchEdit. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
Additional information. On the Nexus One (2.3.4 stock w/stock keyboard), when the app starts, touching the EditText will bring up the soft keyboard in one of the following states: 1. The keyboard will have the punctuation gallery displayed (? ! , etc.) When in this state, typing will work as expected. The EditText will receive the characters and the application will behave as expected. Pressing the back key will cause the keyboard to close, as expected. 2. The keyboard will not have the punctuation gallery displayed. When in this state, typing will start the Google Quick Search Box. Pressing the back key will close the app rather than closing the keyboard. - I've been able to replicate this on a Nexus One (2.3.4) and G-Slate (3.0.1). - The problem is intermittent and usually requires the device to sit for at least an hour after a successful execution before trying it again. - After sitting, it is far more likely to reproduce the issue. Weird... - It would also seem that the problem in my app only reproduces immediately after startup. Once the keyboard works properly, the problem doesn't occur during that session. The app has the min-sdk set to 3 and runs fine on the 1.5 emulator. This problem reproduced with the target apk at 1.6 and 2.3.3. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
FWIW, I've never seen this on my Nexus One 2.3.4 On Jun 7, 8:04 am, Eric Carman ewcarma...@gmail.com wrote: Additional information. On the Nexus One (2.3.4 stock w/stock keyboard), when the app starts, touching the EditText will bring up the soft keyboard in one of the following states: 1. The keyboard will have the punctuation gallery displayed (? ! , etc.) When in this state, typing will work as expected. The EditText will receive the characters and the application will behave as expected. Pressing the back key will cause the keyboard to close, as expected. 2. The keyboard will not have the punctuation gallery displayed. When in this state, typing will start the Google Quick Search Box. Pressing the back key will close the app rather than closing the keyboard. - I've been able to replicate this on a Nexus One (2.3.4) and G-Slate (3.0.1). - The problem is intermittent and usually requires the device to sit for at least an hour after a successful execution before trying it again. - After sitting, it is far more likely to reproduce the issue. Weird... - It would also seem that the problem in my app only reproduces immediately after startup. Once the keyboard works properly, the problem doesn't occur during that session. The app has the min-sdk set to 3 and runs fine on the 1.5 emulator. This problem reproduced with the target apk at 1.6 and 2.3.3. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
As this is an on-again, off-again problem, it appears to be on again. I can reproduce this on a G-Slate. Back to square one -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText and the unwanted Quick Search Box
Unfortunately, I was able to reproduce this problem today. As such, I believe we can conclude that Voice Recognition had nothing to do with this issue. Back to square one. Has anyone else run into this issue? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
Testing seems to indicate that the work I was doing in the OnKeyListener had some sort of impact, albeit intermittently. I've modified the OnKeyListener to send a message to a handler and that seems to keep everything in order. Since one of the things I was doing in the listener, (when the enter key was pressed) was to set the text of the EditText to an empty string. Perhaps this was just enough to cause some trouble. Thank you for your suggestion, it seems to have led me in a better direction. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
Interesting. I've done as you have suggested (although I'm using the OnKeyListener, the OP is using the editor action listener) and so far no issues. I need to test on a different device to be sure (the one that most frequently demonstrated this issue) and since it is an intermittent problem, I suppose it will take a bit of testing to make sure. Have you run into issues with these listeners and the EditText? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
I have run into this as well. The edit text will accept entry without issue, then it just stops displaying the text entered, but it is there because the getText will find it. EditText android:id=@+id/inputText android:layout_width=fill_parent android:layout_height=wrap_content android:layout_weight=1 android:inputType=textMultiLine / Like you, I originally had the requestFocus / property set, but had to get rid of it as it seemed to be causing other issues. This error occurs both with and without that attribute. Like your code above, I get the text and set it to an empty string when finished. I use an EditText.OnKeyListener and perform my work on KeyEvent.KEYCODE_ENTER and KeyEvent.KEYCODE_DPAD_CENTER, however. I haven't seen this behavior on an emulator, but I have seen it on an LG device. Web searches seem to indicate that it might occur on Samsung devices as well and some of my customers have reported it in market comments (so I don't know what devices they are using) so I don't think it is a device specific bug But who knows. Hopefully someone has some insight. Best Regards, Eric -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText stops displaying characters as I'm typing?
Simply question: Does the problem happen if you remove your editor action listener? On May 30, 4:21 am, Eric Carman ewcarma...@gmail.com wrote: I have run into this as well. The edit text will accept entry without issue, then it just stops displaying the text entered, but it is there because the getText will find it. EditText android:id=@+id/inputText android:layout_width=fill_parent android:layout_height=wrap_content android:layout_weight=1 android:inputType=textMultiLine / Like you, I originally had the requestFocus / property set, but had to get rid of it as it seemed to be causing other issues. This error occurs both with and without that attribute. Like your code above, I get the text and set it to an empty string when finished. I use an EditText.OnKeyListener and perform my work on KeyEvent.KEYCODE_ENTER and KeyEvent.KEYCODE_DPAD_CENTER, however. I haven't seen this behavior on an emulator, but I have seen it on an LG device. Web searches seem to indicate that it might occur on Samsung devices as well and some of my customers have reported it in market comments (so I don't know what devices they are using) so I don't think it is a device specific bug But who knows. Hopefully someone has some insight. Best Regards, Eric -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText Issue
If you want a quick and dirty solution you could try putting an EditText over a TextView, with an OnTextChanged listener set to immediately add what you've typed to the TextView. If you want a clean solution, however, I would advice going with TreKing's suggesting of extending the EditText. On Fri, Apr 15, 2011 at 8:07 AM, TreKing treking...@gmail.com wrote: On Fri, Apr 15, 2011 at 7:44 AM, Bobbie bobbie.st...@gmail.com wrote: It's called real time text. Ah. With the RTT standard, you are supposed to send each character typed, as you type it, so it's actually a great chat app for what I need to do. Ah. It's just that the cursor has to stay at the end so they can't go back and insert text in the middle of the message. For such custom functionality of an existing widget, you're probably best off extending the class and overriding appropriate methods. Thanks for your criticizing instead of helping. Anytime. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText Issue
It's called real time text. With the RTT standard, you are supposed to send each character typed, as you type it, so it's actually a great chat app for what I need to do. It's just that the cursor has to stay at the end so they can't go back and insert text in the middle of the message. Thanks for your criticizing instead of helping. Bobbie On Apr 14, 1:09 pm, TreKing treking...@gmail.com wrote: On Wed, Apr 13, 2011 at 9:17 AM, Bobbie bobbie.st...@gmail.com wrote: I have a project I've been working on for a while, a chat client. However, this one is a specific type. I need to make it so the user can not move the cursor to any part of the text Why? Sounds like the worst chat app ever. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: EditText Issue
On Fri, Apr 15, 2011 at 7:44 AM, Bobbie bobbie.st...@gmail.com wrote: It's called real time text. Ah. With the RTT standard, you are supposed to send each character typed, as you type it, so it's actually a great chat app for what I need to do. Ah. It's just that the cursor has to stay at the end so they can't go back and insert text in the middle of the message. For such custom functionality of an existing widget, you're probably best off extending the class and overriding appropriate methods. Thanks for your criticizing instead of helping. Anytime. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText in Activity show keyboard immediatly
How do that? On 11 Apr, 11:05, luiX_ lui...@gmail.com wrote: Have you tried to manually set the initial focus to any other element in the activity? El 11/04/2011 10:59, pedr0 pulsarpie...@gmail.com escribió: Hi at all, I have an activity with one EditText in layout, when Activity is showed immediatly edittext is focused and keyboard is showed, how avoid it? -- undefined -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- undefined -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText in Activity show keyboard immediatly
I solved using android:windowSoftInputMode=stateHidden Tag in manifest file for my activity. Thanks! On 11 Apr, 11:12, tremendoustur...@gmail.com wrote: You can suppress the keyboard show using InputMethodManager in onFocusChanged listener. On Apr 11, 2011 4:59pm, pedr0 pulsarpie...@gmail.com wrote: Hi at all, I have an activity with one EditText in layout, when Activity is showed immediatly edittext is focused and keyboard is showed, how avoid it? -- undefined -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- undefinedI -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: EditText to filter a listview
I think the problem is that your RestaurantInfo needs to implement toString() so that it can be filtered on correctly. On Apr 2, 12:19 pm, Igor Nesralla Ribeiro nesra...@gmail.com wrote: Hi, i have a edittext and a listview ... I want to do thiswhen the users type on a edittext this will filter a listview But...the problem is the listview returns nothing when I type someword that i have in the list. Can anyone help me ? or there any another simple way to do this Here is my code... public class Restaurants extends Activity { private ListView restaurantListView; private ArrayListRestaurantsInfo mRestaurants; private ListAdapter lstAdapter; EditText edt; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.restaurants); mRestaurants = getRestaurants(); restaurantListView = (ListView) findViewById(R.id.lvRestaurant); lstAdapter = new ListAdapter(this, R.id.lvRestaurant, mRestaurants); restaurantListView.setAdapter(lstAdapter); restaurantListView.setTextFilterEnabled(true); restaurantListView.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub Intent its = new Intent(getBaseContext(),RestaurantsDetails.class); Bundle b = new Bundle(); b.putLong(key,arg3); its.putExtras(b); startActivity(its); } }); edt = (EditText)findViewById(R.id.editText); edt.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged( CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub Restaurants.this.lstAdapter.getFilter().filter(arg0); } @Override public void afterTextChanged(Editable arg0) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub } }); } catch (Exception e) { // TODO: handle exception Log.e(oncreate resta,e.getMessage()); } } public ArrayListRestaurantsInfo getRestaurants(){ DBAdapter dbAdapter=DBAdapter.getDBAdapterInstance(this); try { dbAdapter.createDataBase(); } catch (IOException e) { Log.i(*** select ,e.getMessage()); } dbAdapter.openDataBase(); String query=SELECT * FROM restaurants;; ArrayListArrayListString stringList = dbAdapter.selectRecordsFromDBList(query, null); dbAdapter.close(); ArrayListRestaurantsInfo restaurantsList = new ArrayListRestaurantsInfo(); for (int i = 0; i stringList.size(); i++) { ArrayListString list = stringList.get(i); RestaurantsInfo restaurant = new RestaurantsInfo(); try { restaurant.id = Integer.parseInt(list.get(0)); restaurant.res_name = list.get(1); restaurant.res_city = list.get(2); } catch (Exception e) { Log.i(*** + Restaurants.class.toString(), e.getMessage()); } restaurantsList.add(restaurant); } return restaurantsList; } private class ListAdapter extends ArrayAdapterRestaurantsInfo{
[android-developers] Re: EditText to filter a listview
The xml file in which you defined the listview add one android property filtertext. You don't have to change anything in code. On Apr 2, 9:19 am, Igor Nesralla Ribeiro nesra...@gmail.com wrote: Hi, i have a edittext and a listview ... I want to do thiswhen the users type on a edittext this will filter a listview But...the problem is the listview returns nothing when I type someword that i have in the list. Can anyone help me ? or there any another simple way to do this Here is my code... public class Restaurants extends Activity { private ListView restaurantListView; private ArrayListRestaurantsInfo mRestaurants; private ListAdapter lstAdapter; EditText edt; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.restaurants); mRestaurants = getRestaurants(); restaurantListView = (ListView) findViewById(R.id.lvRestaurant); lstAdapter = new ListAdapter(this, R.id.lvRestaurant, mRestaurants); restaurantListView.setAdapter(lstAdapter); restaurantListView.setTextFilterEnabled(true); restaurantListView.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub Intent its = new Intent(getBaseContext(),RestaurantsDetails.class); Bundle b = new Bundle(); b.putLong(key,arg3); its.putExtras(b); startActivity(its); } }); edt = (EditText)findViewById(R.id.editText); edt.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged( CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub Restaurants.this.lstAdapter.getFilter().filter(arg0); } @Override public void afterTextChanged(Editable arg0) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub } }); } catch (Exception e) { // TODO: handle exception Log.e(oncreate resta,e.getMessage()); } } public ArrayListRestaurantsInfo getRestaurants(){ DBAdapter dbAdapter=DBAdapter.getDBAdapterInstance(this); try { dbAdapter.createDataBase(); } catch (IOException e) { Log.i(*** select ,e.getMessage()); } dbAdapter.openDataBase(); String query=SELECT * FROM restaurants;; ArrayListArrayListString stringList = dbAdapter.selectRecordsFromDBList(query, null); dbAdapter.close(); ArrayListRestaurantsInfo restaurantsList = new ArrayListRestaurantsInfo(); for (int i = 0; i stringList.size(); i++) { ArrayListString list = stringList.get(i); RestaurantsInfo restaurant = new RestaurantsInfo(); try { restaurant.id = Integer.parseInt(list.get(0)); restaurant.res_name = list.get(1); restaurant.res_city = list.get(2); } catch (Exception e) { Log.i(*** + Restaurants.class.toString(), e.getMessage()); } restaurantsList.add(restaurant); } return restaurantsList; } private class ListAdapter extends
[android-developers] Re: Edittext landscape - not full screen
The answer is this: mEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); if anyone else looks for it! On Mar 2, 10:40 am, André pha...@hotmail.com wrote: In my app my edittext changes to full screen when it's focused and in landscape. I have seen apps that has worked around some how so that the soft keyboard just ends up being on top of the edittext. Any suggestions of how I can achieve this? // André -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Edittext max characters - not set max
I think Andre was looking for a design limit, not how to set one. The control can handle many pages of text, even with spanning styled markup. The EULA which I saw on one Android tablet was shown in a simple text view, and it was about fifty pages of text on the tablet. (The EditText control should have the same limits as the TextView, as the EditText is just some additional features on the basic view.) The answer is how much memory can you allocate? Of course the system needs to allocate resources to measure and typeset and render all of that text. If it's too long, consider showing the text in pages or chunks. On Jan 26, 1:05 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: On 26 January 2011 18:27, André pha...@hotmail.com wrote: Is there a limit on how many characters and or lines you can have in an edittext? Or is it unlimited? http://developer.android.com/reference/android/widget/TextView.html#a... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Edittext max characters - not set max
Thanks Hari that was what I was looking for. The same goes for strings right? So what ever size could be put in a string can be put in a edittext? Or should I use string[] for that instead of a normal string? On Jan 26, 8:05 pm, Hari Edo hari@gmail.com wrote: I think Andre was looking for a design limit, not how to set one. The control can handle many pages of text, even with spanning styled markup. The EULA which I saw on one Android tablet was shown in a simple text view, and it was about fifty pages of text on the tablet. (The EditText control should have the same limits as the TextView, as the EditText is just some additional features on the basic view.) The answer is how much memory can you allocate? Of course the system needs to allocate resources to measure and typeset and render all of that text. If it's too long, consider showing the text in pages or chunks. On Jan 26, 1:05 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: On 26 January 2011 18:27, André pha...@hotmail.com wrote: Is there a limit on how many characters and or lines you can have in an edittext? Or is it unlimited? http://developer.android.com/reference/android/widget/TextView.html#a... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en