Question

I have a tabhost with 4 tabs. Each tab has several editboxes. On real 2.1 device and in emulator I can select any editbox and insert values into them. But in 2.3 emulator and real device - only editboxes on 4th tab are selectable... tab 1 - relative layout tab 2-4 - table layouts. Editboxes have similar properties... I can't see difference between editbox on tab 3 and 4, but behaviour is different.

Notes: 2.1 is 800x480 device (landscape) 2.3 is 1024x768 device (landscape) I have styles for the editboxes - same for both cases...

Does anybody know what can cause this situation?..

Additionally: Just noticed that in 2.1 emulator - if i click on controls within tabs 1-3 everything is ok. But if I g to tab4 and then back to any tab - the editboxes become not selectable on any of tab 1-3 (first one is "selected" but without any responce) - same as in 2.3 (but there those fields are not editable from the start...). And also tab 4 is working, but not the rest... totally as in 2.3

Update: I have a separate layout file for each tab, those are included in the main layout via "include layout" ({include layout="@layout/tab_1_main" /}, {include layout="@layout/tab_2_main" }, etc). Only in the last "included" layout the controls are editable in 2.3 - in others not. If the "include" lines are shuffled (i.e. {include layout="@layout/tab_2_main" /} becomes the last line) then tab 2 is the only tab where controls are editable...

Was it helpful?

Solution

Looks like it's solved.

The "included" layouts had the id (marked as bold) set on the "tablelayout" level

<merge xmlns:android="http://schemas.android.com/apk/res/android">
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            **android:id="@+id/layoutTab2"**
                android:scrollbars="none">
        <TableLayout 
            android:layout_width="fill_parent"

it appears that Android 2.3 couldn't "activate" such layouts when they were shown to the user. When I moved the ID to the top level (scrollview) in each my layout for tab - the problem was solved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top