Hi,
I have a problem with the behavior i got in the following scenario:

-My application was ported from J2ME and was made in 'quick n dirty'
mode so to port it we used the j2ab code (java to android bridge)
which means that we implement J2ME classes using android
implementations.
-the graphics were handled by an extended AbsoluteLayout that takes up
the wole screen and contains on 2 children:
1. a custom view (extending View) that calls our application paint
method that draws all the UI into a bitmap and then paints the bitmap
to the android canvas. in addition this view is the listener of the
keys and touch events that passes them on to our application to
handle. this view takes care of resize too, calling our app screen's
resize function and then to android's invalidate();

2. an EditText component, it's default size set to 50x50 in (0,0), set
to non-visible, focusable in touch mode and in non-touch mode,
transparent background.

now the point of the EditText is that whnever a component in our
application needs to input text we set the parameters for this
EditText, set it's size and position according to our app item using
setLayoutParams,take the text from the item into the Edit text, set it
to visible and ask for focus.
The idea was for the VK to open immediately, but since it didn't
happen we use InputMethodManager's function showSoftInput().

I have basically two problems:
1. when i change from landscape to portrait i unbind the item (remove
focus, remove visibility) and rebind it meaning it should (and it
does, i checked) get new LayoutParams with the new size, but it
doesn't :-? in landscape mode the size is portrait's length and in
portrait it's the size of landscape's length, i didn't manage to
figure out why...

2. sometimes when i click on one of our app fields the EditText is
being positioned in a strange place, it's not always in the same
position sometimes higher, sometimes lower then it should, sometimes
remains stuck on the default, i double checked using logs and it does
have new LayoutParams wiht the right value created, but for some
reason it's being positioned in the wrong place... if te VK get's open
the fields just bounces to where is should be, but if i have a device
like Droid with hardware keyboard, and it's open then the VK wont
open... and then i get a text field in a bad place, with no good
reason.

I'm sure we are doing some steps wrong and maybe set the layout params
too early or too late.
But i couldn't figure out when.
In a small example i've made that just tried to emulate this situation
i couldn't even get the EditText keep it's focus from landscape to
portrait (calling the bind function didn't do anything).

Any hint would help ;-)

10x.
Sorry for the long scroll!!!
Eyal.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to