Managing view's refresh delay and soft keyboard

by Mirthis » Tue, 09 Jun 2009 01:19:07 GMT


Sponsored Links
 I repost here what I've already written on the Android Developer group
cause it fit better here.

Hi to everyone. I start trying out some stuff with Android from few
days so there's lot I don't know but I hope not to sound too stupid.
Here are the first problems I'm facing

1) I have a ListView where each item is made of two icon (on the left
and right side) and an EditText, disabled, in the middle. I have a
button to add new element to the lists and what I want to happen is
that clicking on it a new lne appears in the ListView with the focus
on the EditText so that the user can type a label for the object.
What I tried to do when the button is clicked is:
- add a new object to the array binded to the ListView;
- notify the array adapter that a change as occoured in the data
- retrieve the view object for the last child added to the ListView
- set the focus on the EditText
The problem is that between the call of notifyDataSetChanged() and the
 creation of a new child in the ListView there's a delay and so I'm
not able to get the new created view in the click handler. What's the
best way to handle it?

2) Considering the same scenario when I give focus to the EditText I
see the cursor for editing the field value but the soft keyboard
doens't appear. That's perfect on a device with an hard keyboard, but
what would happen if the device doesn't have one?
The other thing I find weird is that when I tap the EditText the
keyboard finally appears but the field lost the focus so I can type
whatever I want but nothing appear in the field. This latest thing
seems to be in some way related to the fact the EditText is part of
the layout used to display each item in the list. Any idea on how to
solve it?

That's all, I hope it was fairly clear and to get some help.
Thank you for reading

Andrea

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Could use some help (free game on Galaxy S problem)

I put a free trial version of my game (RGBbot Trial Version)
out on the market and although it seems to run well on my
N1 and a friend's Droid X, I'm getting error reports
from Samsung Galaxy S owners with an IllegalStateException
trying to play an audiotrack.

If a Galaxy S owner could send me a logcat after trying
the game, I'd really appreciate it.

The game has an error reporter class in place to catch
exceptions (which is how I'm getting the reports) and it's
SUPPOSED to also send some recent lines from the device log,
but the log sending part doesn't seem to be working on the
Galaxy S phones...

Thanks in advance!

-- 

2. Which Landscape?

I decided to give everyone an easy question.

I already check for landscape via this method:

        if (getResources().getConfiguration().orientation ==
                Configuration.ORIENTATION_LANDSCAPE)

But how do I tell which landscape?

My Nexus One, at least, has two. Left and Right Handed.

And yes, it does matter. If you are trying to relate a compass sensor
to the screen, for example.

Nathan

-- 

3. how to disable auto screen brightness?

4. Bluetooth headset noise-cancellation activation through android app

5. IOException: SSL handshake failure problem in Eclair

6. Ready to release first app. What now?

7. Horizontal GridView scrolling