Dear All,

Got a little progress in the blinking issue. Made
the following observation. The method:

      tabHost.clearAllTabs();

Does not clear the selected status of the tabs in
the tab widget. As a result one can provoke multiple
selected tabs:

+------+------+------+------+
| Tab1 | Tab2 | Tab3 | Tab4 |
+------+------+------+------+

Tab2 selected
and Tab3 selected

I found the following work-around which mittigates
a little bit the problem. Insert a tabHost.setCurrentTab(0)
in front of the tabHost.clearAllTabs():

    >>> tabHost.setCurrentTab(0); <<<
        tabHost.clearAllTabs();
        tabHost.addSpec(spec1)
        ..
        tabHost.addSpec(specn)

This works since after tabHost.clearAllTabs() the selected
index is set to -1. And then tabHost.addHost(), when it
sees selected index = -1, will set the selected index to 0.
So that after the first tabHost.addHost() the invariant
that the selected index corresponds with the select status
of the tabs is guaranteed.

But still the blinking is not yet perfect. I now got
most of the time the first tab not blinking, but the
other tabs will now blink. Sometimes even more tabs
than only the first tabs don't blink. But the situation
is already better.

And since I do visualize the tab selection status now,
with the above fix, this visualization is now always
consistent, no more multiple selected tabs seen. But
still working on it...

Best Regards

P.S.: Work around so far inspired by this discussion:
http://code.google.com/p/android/issues/detail?id=2772

Jan Burse schrieb:
The blinker runs in the UI thread. And it is kept alive and
it keeps itself aliver in posting delayed messages. You
find the source code here:

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/widget/TextView.java#TextView.Blink


There is a condition isFocused() inside the Blink. I have
checked my application, the TextView I am using gets correctly
focused. There shouldn't be a problem with focusing. Here
is the result of some debugging code:

02-20 10:21:47.362: WARN/System.err(579): text =
xxx.TerminalArea@412f8368 text.isFocused = false
02-20 10:21:47.362: WARN/System.err(579): text =
xxx.TerminalArea@414044c8 text.isFocused = true

414044c8 Blinks! OK

After switching the tab:

02-20 10:22:57.445: WARN/System.err(579): text =
xxx.TerminalArea@412f8368 text.isFocused = true
02-20 10:22:57.445: WARN/System.err(579): text =
xxx.TerminalArea@414044c8 text.isFocused = false

412f8368 Does not Blink! NOK

So I guess a problem with focusing can be ruled out. What
other cause could be identified for the frozen cursor?

Bye

lbendlin schrieb:
i guess you are not a good thinker, and are unwilling to try my
suggestions because they "don't seem to make sense". Fair enough.

--
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

Reply via email to