param
param

Reputation: 493

Input text field doesn't display text being typed on Gingerbread and below?

I have a edit text for the given xml file


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/mainbg"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight=".5"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/user_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:layout_weight="0.1"

                android:ems="10"
                android:hint="Full Name"
            android:singleLine="true"
                 />

            <EditText
                android:id="@+id/user_add"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:layout_weight="1"
                android:ems="10"
                android:gravity="top"
                android:hint="Address"
                android:inputType="textMultiLine"
                android:ellipsize="end"
                 />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:layout_marginTop="5dp"
            android:layout_weight=".1" >

            <Button
                android:id="@+id/user_area"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="30"
                android:hint="Area"
                android:textColor="#006999"
                android:textCursorDrawable="@null" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="17"
                android:orientation="vertical" >
            </LinearLayout>

            <EditText
                android:id="@+id/user_city"
                android:layout_width="141dp"
                android:layout_height="match_parent"
                android:layout_weight=".5"
                android:ems="10"
                android:hint="City"
                android:textColor="#006999"
                android:textCursorDrawable="@null" >

                <requestFocus />
            </EditText>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight=".4"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/user_email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:layout_weight="1"
                android:ems="10"
                android:hint="Email"
                android:textColor="#006999"
                android:textCursorDrawable="@null" />

            <EditText
                android:id="@+id/user_phone_no"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:layout_weight="1"
                android:ems="10"
                android:hint="Phone Number"
                android:inputType="number"
                android:textColor="#006999"
                android:textCursorDrawable="@null" />

            <EditText
                android:id="@+id/user_its_code"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:layout_weight="1"
                android:ems="10"
                android:hint="ITS/Ejamaat Number"
                android:inputType="number"
                android:textColor="#006999"
                android:textCursorDrawable="@null" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight=".2"
            android:orientation="vertical" >
        </LinearLayout>

        <RelativeLayout
            android:id="@+id/InnerRelativeLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_gravity="center"
            android:gravity="center" >

        <Button 

            android:id="@+id/btn_save"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Save"
             >
        </Button>



    </RelativeLayout>
    </LinearLayout>

</LinearLayout>

It is working perfectly fine in ICS and JellyBean but in Gingerbread/Froyo etc the edit text is not editable(whatever user inputs does not show in the edit text) . I have no clue for this wierd behaviour . please help

Upvotes: 0

Views: 206

Answers (2)

user2323471
user2323471

Reputation: 85

Please Try this code on device it issues in simulator. Dont be panic for this code.

Upvotes: 0

foxt7ot
foxt7ot

Reputation: 2515

Don't know why you are getting this weird issue, I had tested your code on Android 2.2 Froyo with API 8 and it was working flawlessly. If you are testing on simulator i suggest to uninstall your app from the simulator than again try to deploy and test it.

Upvotes: 1

Related Questions