Question

I have made a simple android activity with some edit texts and some TextVies and "header" and "footer" layouts,Now all is working well,but at runtime ,when i click on any on EditText the numberpad popups and comes with my "footer" layout.I have put my activity image below so that you can get my problem,My code is as below:

main.xml

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <RelativeLayout
            android:id="@+id/relativeLayout2"
            android:layout_width="fill_parent"
            android:layout_height="56dp"
            android:padding="3dp" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="General Details"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold" />

            <Button
                android:id="@+id/back1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:text="Back" />

            <Button
                android:id="@+id/Next1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:text="Next" />

        </RelativeLayout>
         <SeekBar
                        android:id="@+id/seekBar1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_alignParentTop="true" />

            <ScrollView 
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"  android:layout_weight="0.23" android:fillViewport="true">

                <RelativeLayout
                    android:id="@+id/relativeLayout2"
                    android:layout_width="fill_parent"
                    android:layout_height="509dp"
                    android:background="#fffff3"
                    android:padding="10dp" >


                    <EditText
                        android:id="@+id/editTextPropertyCalc1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc2"
                        android:layout_alignParentRight="true"
                        android:layout_alignParentTop="true"
                         android:inputType="numberDecimal" android:imeOptions="actionNext">

                    </EditText>

                    <EditText
                        android:id="@+id/editTextPropertyCalc2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc1"
                        android:layout_toRightOf="@+id/imageButtonCalcTip2"
                        android:inputType="numberDecimal" android:imeOptions="actionDone"/>

                    <EditText
                        android:id="@+id/editTextPropertyCalc3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc1"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc2"
                        android:inputType="numberDecimal" android:enabled="false" android:focusableInTouchMode="false" android:focusable="false"/>

                    <TextView
                        android:id="@+id/textView2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc3"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc3"
                        android:textAppearance="?android:attr/textAppearanceMediumInverse"
                        android:typeface="serif" />

                    <EditText
                        android:id="@+id/editTextPropertyCalc4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc3"
                        android:layout_alignRight="@+id/textView2"
                        android:layout_below="@+id/textView2"
                        android:inputType="numberDecimal" android:imeOptions="actionNext"/>

                    <EditText
                        android:id="@+id/editTextPropertyCalc5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc4"
                        android:layout_alignRight="@+id/textView2"
                        android:layout_below="@+id/editTextPropertyCalc4"
                        android:inputType="numberDecimal" android:imeOptions="actionNext"/>

                    <EditText
                        android:id="@+id/editTextPropertyCalc6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc4"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc5"
                        android:inputType="numberDecimal" android:imeOptions="actionNext"/>

                    <EditText
                        android:id="@+id/editTextPropertyCalc7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc5"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc6"
                        android:inputType="numberDecimal" android:imeOptions="actionDone"/>

                    <EditText
                        android:id="@+id/editTextPropertyCalc8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/editTextPropertyCalc6"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/editTextPropertyCalc7"
                        android:inputType="numberDecimal" android:enabled="false" android:focusableInTouchMode="false" android:focusable="false"/>

                    <Button
                        android:id="@+id/buttonPropertyCalcClear"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/togglebutton"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="20dp"
                        android:text="Clear All" />

                    <TextView
                        android:id="@+id/TextView01"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc1"
                        android:layout_alignBottom="@+id/editTextPropertyCalc1"
                        android:layout_alignLeft="@+id/textView2"
                        android:text="Purchase Price"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/textView3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc2"
                        android:layout_alignParentLeft="true"
                        android:layout_alignTop="@+id/imageButtonCalcTip2"
                        android:text="Refurnishment Cost"
                        android:gravity="center"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView03"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc3"
                        android:layout_alignBottom="@+id/editTextPropertyCalc3"
                        android:layout_alignLeft="@+id/textView2"
                        android:text="Legal Cost"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView02"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc4"
                        android:layout_alignBottom="@+id/editTextPropertyCalc4"
                        android:layout_alignParentLeft="true"
                        android:layout_alignRight="@+id/textView3"
                        android:text="Mortage Loan to Value(LTV)% "
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView04"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc5"
                        android:layout_alignBottom="@+id/editTextPropertyCalc5"
                        android:layout_alignParentLeft="true"
                        android:layout_alignRight="@+id/TextView02"
                        android:text="Mortage Interest Rate %"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView05"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc6"
                        android:layout_alignBottom="@+id/editTextPropertyCalc6"
                        android:layout_alignParentLeft="true"
                        android:text="Monthly Rent"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView06"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/editTextPropertyCalc7"
                        android:layout_alignBottom="@+id/editTextPropertyCalc7"
                        android:layout_alignParentLeft="true"
                        android:text="Letting Agent Fees"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                    <TextView
                        android:id="@+id/TextView07"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc8"
                        android:layout_alignLeft="@+id/TextView06"
                        android:layout_alignRight="@+id/TextView04"
                        android:layout_below="@+id/imageButtonCalcTip7"
                        android:text="Montlhly Operating Expenses %"
                        android:textAppearance="?android:attr/textAppearanceSmallInverse"
                        android:typeface="serif" />

                     <TextView
                         android:id="@+id/TextView8"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"

                         android:layout_marginTop="390dp"
                         android:layout_marginRight="180dp"            
                         android:text="Will you be borrowing any of the deposit money?"
                         android:textAppearance="?android:attr/textAppearanceSmallInverse"
                         android:typeface="serif" />

                        />




                    <ImageButton
                        android:id="@+id/imageButtonCalcTip1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc1"
                        android:layout_alignTop="@+id/editTextPropertyCalc1"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />
                    <ImageButton
                        android:id="@+id/imageButtonCalcTip2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc2"
                        android:layout_alignTop="@+id/editTextPropertyCalc2"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <ImageButton
                        android:id="@+id/imageButtonCalcTip3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc3"
                        android:layout_alignTop="@+id/editTextPropertyCalc3"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <ImageButton
                        android:id="@+id/imageButtonCalcTip4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc4"
                        android:layout_alignTop="@+id/editTextPropertyCalc4"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <ImageButton
                        android:id="@+id/imageButtonCalcTip5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc5"
                        android:layout_alignTop="@+id/editTextPropertyCalc5"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <ImageButton
                        android:id="@+id/imageButtonCalcTip7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc7"
                        android:layout_alignTop="@+id/editTextPropertyCalc7"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <ImageButton
                        android:id="@+id/imageButtonCalcTip8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc8"
                        android:layout_alignTop="@+id/editTextPropertyCalc8"
                        android:layout_toRightOf="@+id/TextView02"
                        android:background="#0000"
                        android:padding="10dp"
                        android:scaleType="fitCenter"
                        android:src="@android:drawable/ic_dialog_info" />

                    <Button
                        android:id="@+id/buttonMortgageAmount"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBottom="@+id/editTextPropertyCalc3"
                        android:layout_alignLeft="@+id/editTextPropertyCalc3"
                        android:layout_alignRight="@+id/editTextPropertyCalc3"
                        android:layout_alignTop="@+id/editTextPropertyCalc3" android:background="#0000"/>

                    <ToggleButton
                        android:id="@+id/togglebutton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="250dp"
                        android:layout_marginLeft="200dp"
                        android:layout_below="@+id/editTextPropertyCalc3"
                        android:textOff="No"
                        android:textOn="Yes" />

                </RelativeLayout>

    **</ScrollView>** 

   <LinearLayout
            android:id="@+id/linearLayout3"
            android:layout_width="fill_parent"
            android:layout_height="46dp"
            android:background="@drawable/gradient_grey" >

                <LinearLayout 
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="1" android:orientation="vertical">
                <ImageButton
                    android:id="@+id/imageButtonHome"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:src="@drawable/g3570" android:layout_weight="0.6" android:background="#0000" android:scaleType="fitCenter" android:layout_marginTop="5dp"/>

                <TextView                 android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                     android:layout_weight="1"
                     android:text="Home"
                    android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>

                </LinearLayout> <LinearLayout 
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="1" android:orientation="vertical">

                <ImageButton
                    android:id="@+id/imageButtonTraining"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:src="@drawable/g4404" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
                    <TextView                 android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                     android:layout_weight="1"
                     android:text="Training"
                    android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>

                </LinearLayout> <LinearLayout 
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="1" android:orientation="vertical">
                <ImageButton
                    android:id="@+id/imageButtonContactUs"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:src="@drawable/icon_email" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
                   <TextView                 android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                     android:layout_weight="1"
                     android:text="Contact Us"
                    android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>

                </LinearLayout>
            </LinearLayout>
        </LinearLayout>

My image of Activity is as below:

enter image description here

Please help me for my this error .thank you friends.

Was it helpful?

Solution

Try this code this is worked for me...

  public class Calculator extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.calculator);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

}
}

OTHER TIPS

Use this code below this will help you...

getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

 or Use this code

 <application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
          android:label="@string/app_name"
          android:windowSoftInputMode="stateHidden"
          >

Sorry for late

In my case, I have added these lines of code below in the Oncreate function and top of the Layout

like below

enter image description here

code is here:

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top